问题描述
我想从水晶报表中调用存储过程并将检索到的值分配给报告中的字段?
I'd like to call a Stored Procedure from a crystal report and assign retrieved value to a field in report?
有什么建议吗?
推荐答案
从水晶报表中调用存储过程,
To call Stored Procedure from crystal report,
将报表的数据源设置为存储过程(数据库专家向导).该程序必须满足这些要求
Set data source of report to Stored Procedure (DataBase Expert Wizard). That procedure must met thses requirement
1- 您必须创建一个包来定义 REF CURSOR(将被检索的字段类型).
1- You must create a package that defines the REF CURSOR (type of field that will be retrieved).
2- 过程必须有一个 REF CURSOR 类型的参数.这是因为 CR 使用此参数来访问和定义存储过程返回.
2- The procedure must have a parameter that is a REF CURSOR type. This is because CR uses this parameter to access and define the result set that the stored procedure returns.
3- REF CURSOR 参数必须定义为 IN OUT(读/写模式).
3- The REF CURSOR parameter must be defined as IN OUT (read/write mode).
4- 参数只能是输入(IN)参数.CR 不是为工作而设计的带 OUT 参数.
4- Parameters can only be input (IN) parameters. CR is not designed to work with OUT parameters.
5- REF CURSOR 变量必须打开并在过程.
5- The REF CURSOR variable must be opened and assigned its query within the procedure.
6- 存储过程只能返回一个记录集.这个结构根据参数,记录集不得更改.
6- The stored procedure can only return one record set. The structure of this record set must not change, based on parameters.
7- 存储过程不能调用另一个存储过程.
7- The stored procedure cannot call another stored procedure.
这篇关于如何从 CrystalReport 调用 StoredProcedure?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!