Crystal Reports不显示存储过程输出 [英] Crystal Reports not showing stored procedure outputs

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

问题描述

我在SQL Server中创建了一个存储过程。



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



这是存储过程中的代码:

  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)$ b $在水晶报表中,我可以看到 @mcode $ c>和 @zcode 作为输入参数。但我看不到 @gmas @vmas @odolmas 作为输出。



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



感谢

解决方案

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



说明例如在您的存储过程中选择@gmas为Col1,@vmas为Col2过程,可以将coleds显示为col1和col2。您可以将这些col1和col2放在报表上以便显示。


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

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

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

Thanks

解决方案

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.

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不显示存储过程输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆