Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2014

    Unanswered: Filter data in subreport based on a value passed from main report

    Hi All,
    I am using crystal report 2008.
    In the crystal report that I have designed, has a main report and a subreport.
    A date value from main report has to be passed to the subreport and based on that date, the records should be filtered, in the sub report.
    What I have done is created a shared variable for this date value, in the main report,like below. The value is pulled to report and is showing the correct value in main report.

    shared datevar shdtvlu;

    Same has been created in subreport and is showing the date value, correctly,in the subreport.

    shared datevar shdtvlu;

    Now the result in the subreport ,should be filtered ,based on this value.
    All the records,less than this date, should be shown in the subreport.

    Can anyone please guide me on this regard? Is there any alternate way, other than my approach to accomplish this.

    Thanks to all the helping hands out there..

  2. #2
    Join Date
    Jan 2007
    Provided Answers: 12
    From the main report, right-click the subreport and chose "Change Subreport Links..."
    This allows you to pass the value to the subreport either as a filter to a given field in the subreport, or as a parameter (you may wish to untick the box labelled "Select Data in subreport based on field:" if you just want it as a vanilla parameter).

    Then in your subreport you can add the parameter to the record selection formula however you see fit.
    Home | Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts