Skip to Content

Subreport with stored procedure and additional parameters

Dec 29, 2016 at 10:17 AM


avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Abhilash Kumar
Jan 02, 2017 at 07:53 AM


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.


10 |10000 characters needed characters left characters exceeded
Vitaly Izmaylov
Dec 29, 2016 at 08:48 PM

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.

10 |10000 characters needed characters left characters exceeded