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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

770 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