on 12-24-2014 12:00 PM
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..
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
you can't filter sub report data based on main report unless there is a link between the fields from main report to sub report.
Here you are not linking main report field with sub report
You are just getting date from main report and linking same date from sub report which is of no use to filter data in sub report.
You have to get a filed from sub report (date) and then link with main report to get filtered data.
Simply there should be a data field coming from sub reports query.Then link this with main reports date filed
Hi,
I am pretty much new to subreports and the linking from main report to subreport.
Is it the way, like shared variable I created in the mainreport is linked to a date field in main report. Same like that the shared variable ,in the subreport also has to be linked to a field in the subreport, right?
Thanks,
Ann
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.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.