Skip to Content
avatar image
Former Member

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.


WhilePrintingRecords;

shared datevar shdtvlu;

shdtvlu:={@dtvlu1};


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

shared datevar shdtvlu;

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Dec 24, 2014 at 12:04 PM

    Hi Ann,

    There should be a link between main report and sub report to filter data.

    You have to link your main report date filed with other date field in your sub report using links tab.

    Then you will get sub reports data based on main report

    Add comment
    10|10000 characters needed characters exceeded