Skip to Content
avatar image
Former Member

How to link Date range from Main Report To Sub report In Crystal report?

Hi,

I have to link the date range from main report to sub reports.

In my report i have used one stored procedures for two sub reports with different record selection formula but with same Date range.

Here i have to pass the date range from main report to sub reports.

How to link Date range from Main Report To Sub report In Crystal report?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 16, 2013 at 11:56 AM

    Hi Swapnil,

    Here's how its done:

    1) Create a formula in the Main report; call it Start_date:

    Minimum({?Date_parameter})

      

    2) Create a second formula in the Main report and call it End_date:

    Maximum({?Date_parameter})

      

    3) Insert the sub-report and then Right-click the sub-report > Select Change Subreport links > Move the Start_date and End_date formulas to 'Fields to Link to' area and make sure you uncheck the 'Select data in subreport based on field' option.

    4) Edit the sub-report (Right-click > Edit) and insert a Record Selection formula to include the parameters from the Main Report.

    Go to Report > Selection Formulas > Record:

    {date_field} >= {?Pm-@Start_date} and {date_field} <= {?Pm-@End_date}

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Abhilash Kumar

      Hi,

      Abhilash & Prathamesh Thank you for your replay.

      I have created new SP by which without using sub report i can able to get required data on main report. 😊

      --Swapnil Vichare