Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
Former Member replied

Hi Ann,

No need of shared variable concept here.

You have to do like this.

Lets say I have a date field in main report So I need to filter sub reports data based on this date field.

So to do this you need to have a date filed in sub report also.Means it should be in sub reports command object(query)

Then link date field from main report to sub report using links tab.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question