Crystal Reports 不显示存储过程输出

Crystal Reports not showing stored procedure outputs(Crystal Reports 不显示存储过程输出)
本文介绍了Crystal Reports 不显示存储过程输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SQL Server 中创建了一个存储过程.它在那里工作得很好.

I created a stored procedure in SQL Server. It works fine there.

当我从 Crystal Reports 调用它时,它会显示参数字段,但不会显示数据库字段中的输出.实际上它在数据库字段中显示存储过程,而不是在存储过程旁边的输出字段或+号.

When I call it from Crystal Reports, it shows parameters fields but it does not show the outputs in database fields. Actually it shows the stored procedure in database fields but not the output fields or + sign beside the stored procedure.

这是存储过程中的代码:

Here is the codes in stored procedure:

CREATE PROCEDURE [test]
           @mcode char(10),
           @zcode [int], 
           @odolmas[float]=0 output,
           @gmas[float]=0 output,
           @vmas[float]=0 output          
AS
       set @gmas=0
       set @vmas=0
       set @gmas=9
       set @vmas=5

       set @odolmas=((@vmas-@gmas)/2)
GO

在 Crystal Reports 中,我可以看到 @mcode@zcode 作为输入参数.但我看不到 @gmas@vmas@odolmas 作为输出.

In Crystal Reports I can see the @mcode and @zcode as input parameters. But I cannot see @gmas, @vmas and @odolmas as outputs.

请帮我做,因为我不专业,请一步一步说我该怎么做

Please help me do it and because I am not professional please say it step by step what should I do

谢谢

推荐答案

当我们执行您问题中显示的存储过程时,我们不会得到任何输出.尝试在存储过程中使用 select 语句,水晶报表会看到返回值.

When we execute the stored procedure shown in your question, we won't get any output. Try using the select statement inside your stored procedure, the return values will be seen by crystal report.

比如说在你的程序最后选择@gmas as Col1,@vmas as Col2,可能会将文件显示为col1和col2.您可以将这些 col1 和 col2 放在您的报告中以进行显示.

Say for example Select @gmas as Col1, @vmas as Col2 in your procedure at the end, may show the fileds as col1 and col2. You can place these col1 and col2 on your report for display purpose.

这篇关于Crystal Reports 不显示存储过程输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)
How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?(如何使用Microsoft SQL Server Management Studio生成数据库的实体关系(ER)图?)