Skip to Content
avatar image
Former Member

What version of crystal reports handles linking of input parameters to stored procedures.

I have version 8.5 and cannot link the parameters in the main report to a subreport that uses a stored procedure as it's data source.

I know this is an old version of CR . Does it work in later versions?

I have no trouble linking to subreport SS using tablesasa data source just the one with a stored procedure. Any help would be appreciated.


Tom Hawle

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jan 20, 2017 at 07:30 AM

    Hi Thomas,

    Are the two datatypes (Input prompt's and subreport's prompts) similar?


    Add comment
    10|10000 characters needed characters exceeded

  • Jan 22, 2017 at 12:10 PM


    Probably it is fits version 8.5 also: (this was a method for Crystal Reports version 7.0.)

    First you need to link the subreport's stored procedure parameter to a main report database field, then create a parameter in the main report and finally compare the value(s) for this parameter against the main report database field in a record selection formula.

    1. In the main report, insert a subreport that is based on the stored procedure:

    On the 'Insert' menu, click 'Subreport'. This opens the 'Insert Subreport' dialog box.

    Click 'Create a subreport' and type a name for this subreport.

    Click 'Report Expert'. This opens the Subreport Expert dialog box, where you specify the datasource, fields, and so on to include in the subreport.

    Once you've gone through the necessary tabs for your subreport, click 'OK'. This brings you back to the Insert Subreport dialog box.

    2. Link the subreport to the main report.

    While still in the Insert Subreport dialog box, click the 'Link' tab.

    In the 'Container Fields' box, click the main report field that on which you want to link the subreport.

    Click the '>>' button to add the field to the 'Fields to Link to' box.

    In the 'Subreport parameter field to use:' box, select the stored procedure parameter.

    Click 'OK'. This brings you back to the report.

    3. Create a parameter field in the main report:

    On the 'Insert' menu, click 'Parameter Field'.

    Click 'New'. This opens the Create Parameter Field dialog box.

    Type a name (let's call it Main Parameter) and prompting text for the parameter.

    In the 'Data type' box, select the same data type as the main report linking field from step 2.

    Click 'OK' to return to the report.

    4. Create a record selection formula based on the parameter field:

    On the 'Report' menu, click 'Edit Selection Formula', then point to 'Record'. This opens the Record Selection Formula Editor.

    Type the following formula:

    //For {table.field}, substitute the actual database field

    // used in step 2 to link the main report to the subreport's

    //stored procedure parameter

    {?Main Parameter) = {table.field}

    Save the formula and close the Formula Editor.

    When you next refresh the report, you will be prompted to enter a value which will be passed to the stored procedure parameter in the subreport.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 23, 2017 at 10:40 PM

    Thanks for your response.

    I will try to implement your solution and let you know the results.


    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 24, 2017 at 06:03 PM

    Once I reviewed in detail your suggestion I realized it's the same as I've trying.

    It still prompts for the sp paramters and will not link the main rpt data field to the sp param.

    It creates another parameter in the the sub report but does not even populate it with the linked data field in the main report let alone the sp parameter.

    Can you tell me which CR version will handle the stored prcedure parameter linking properly.

    I will upgrade to a later version if that's what it takes.


    Add comment
    10|10000 characters needed characters exceeded