如何从CrystalReport调用StoredProcedure的?CrystalReport、StoredProcedure

2023-09-03 03:08:46 作者:被强煎的蛋

我想从一个水晶报表调用存储过程并指定检索值 在报表中的字段?

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,

存储过程(数据库专家向导)报告设置数据源。 这个过程必须满足thses要求

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游标变量必须打开,并在指定的查询 程序

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.