cancel
Showing results for 
Search instead for 
Did you mean: 

Subreport with stored procedure and additional parameters

Former Member
0 Kudos

I have a Crystal report in which the main page has 1 parameter 'Param1'. There is a subreport in report header which has data source as stored procedure (having 1 input parameter). In the main report via 'Change subreport links', I have linked parameter Param1 of the main report with the input parameter of the subreport.

When I execute the report I get parameter selection screen for 'Param1'. Upon selecting the values, the stored procedure in sub report gets executed successfully with input parameter=Param1. Now, I want to define 2 more parameters in sub report and want them to be presented to the user. Data which is returned by the stored procedure should be filtered on the basis of the 2 parameters selected in the subreport. Is this possible?

Accepted Solutions (0)

Answers (2)

Answers (2)

abhilash_kumar
Active Contributor

Hi,

While it's not impossible to create parameters and filter records, you would want to avoid what you're trying to do with a stored procedure.

You should modify the Stored Proc and include the two parameters (as well as use it in the where clause) - CR will automatically pick up these prompts after you 'verify database'.

The advantage of having prompts in the Stored Proc is that, all filtering would be handled by the database thereby improving query and report performance.

-Abhilash

vitaly_izmaylov
Employee
Employee
0 Kudos

Why not?

Just add two parameters to the subreport and both parameters will be prompted for the User.

If subreport parameter is not linked then it prompts for a user at the very beginning.