Calling a stored procedure multiple times for same CR

Hello,

Version: Crystal Reports XI

Query 1: I need to call a stored procedure multiple times for single instance of a crystal report but with different parameters each time. Is it possible to do so and if yes could somebody please suggest me an approach for that.

Suggested solution for Query 1: I have read somewhere that we can use temp tables in CR to store the results of multiple stored procedure calls, for a single instance of a CR. After, we have stored the results of a number of iterations of stored procedure calls in multiple temp tables; we can finally join all the temp tables. Full description was not mentioned for this approach so just want to know if this solution is possible in CR XI. If yes, could some explain a bit?

Thanks
SG


sgrover9 (BOB member since 2012-06-05)

Hi Grover,

Did you find solution to it? As I am also looking for something like this.

Raj :wave:


Rajasopa (BOB member since 2007-08-22)

Not yet, Raj!


sgrover9 (BOB member since 2012-06-05)

Grover,
When you say multiple calls, do you mean 1 execution calling the SP several timesand returning all the results in 1 report, or multiple executions of the crystal report each with seperate parameters?

My understanding is that if you are looking for the first piece, multiple executions of an SP returning to one report that this is not something that Crystal supports as the REF Cursor cannot be dynamic and is executed only as the last pice of each exection of hte SP. That being said, IF you can pass the paramters (via a parameter or having them stored in a table that is read) you can control/execute the SP(call it) with a controling SP that will return the ref cursor. The called SP will write to a defined(report) table for each exection and the calling SP will open the ref cursor and read this table as it’s data source. We are doing something similar in a report project currently. Our largest piece of logic was determining when to delete the rows of the report table. We used one of the parameters passed in to Crystal to control the deletes.
Multiple executions on the other hand just mean seperate instances of the report each with the parameters needed.

Let me know if you have additional questions.


amosgreg (BOB member since 2012-01-27)