Skip to Content
avatar image
Former Member

Subreport with stored procedure and additional parameters

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • 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.


    Add comment
    10|10000 characters needed characters exceeded

  • 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.

    Add comment
    10|10000 characters needed characters exceeded