Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Call Stored Procedure Multiple Times

Posted on 2005-03-07
Medium Priority
Last Modified: 2012-05-07
I have a Crystal Report that pulls data from a SQL Server stored procedure.

The report compares statitics from certain weeks from year to year.

An example of the report is as follows:

2005 Notifications     45            67          100
2004 Notifications     34            92          55
Total                      79             159        155

2005 Charges          3              9             5
2004 Charges          7              14           1
Total                      10             23           6


There are a couple of rows of data, and then a total line.  The stored procedure only retreives data for one year at a time.

Is there a way to call a stored procedure multiple times for a report?

I have tried to just add the stored procedure to the document multiple times, but it only gives me one parameter field, and all the rows bring back the same data.

Question by:cswebdev
LVL 26

Accepted Solution

Kurt Reinhardt earned 2000 total points
ID: 13480508
The short answer is no - a stored procedure can only be executed once per report.  You could use subreports, but you don't really need to.  In this case, I'd recommend modifying the stored procedure so that it returns multiple years of data.  If you aren't able to, I'd suggest speaking with your DBA.


Expert Comment

ID: 13481193
after modifying the stored procedure to retrieve all the years you need, then use groups to group the data together by each year.

LVL 101

Expert Comment

ID: 13482707
Agree with both comments above.


Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question