Crystal Reports not showing stored procedure outputs(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 不显示存储过程输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Crystal Reports 不显示存储过程输出
基础教程推荐
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
