SubReport and DataSources
Hi,
can I use the same data source for both report and his subreport?
I have a report with some TextObject (in a GroupHeaderBand, in a DataBand and in a GroupFooterBand) and it works properly.
When I add this changes to the report:
1) I split the DataBand in 3 ChildBand of GroupHeaderBand (setting DataBand visible to false)
2) I create 3 Subreports, one for each ChildBand
2) Each subreport has the same data source of the main report, but the Filter property with different conditions
In the preview I see data in GroupHeaderBand and in a Subreport but I don't see data in GroupFooterBand.
Thanks
can I use the same data source for both report and his subreport?
I have a report with some TextObject (in a GroupHeaderBand, in a DataBand and in a GroupFooterBand) and it works properly.
When I add this changes to the report:
1) I split the DataBand in 3 ChildBand of GroupHeaderBand (setting DataBand visible to false)
2) I create 3 Subreports, one for each ChildBand
2) Each subreport has the same data source of the main report, but the Filter property with different conditions
In the preview I see data in GroupHeaderBand and in a Subreport but I don't see data in GroupFooterBand.
Thanks
Comments
Let me add a reply here.
I actually tried this last week and it won't work (unless you do some major .net coding to save/restore the current dataset record position at the beginning/end of the subreports).
When your first subreport runs it iterates through the data in it's dataset. Since this is the same dataset as the parent report when the subreport finishes, the parent report is at the end of the dataset and has no more records.
You need to have 2 different datasets, 1 for the parent and 1 for the subreports. That way as the subreport runs through the dataset, the parent is still on the same record. It also makes it easy to filter the child (subreport.filterfield==parentreport.filterfield).