Often I'm creating reports in Visual Studio's Crystal Reports and want to have a master-detail or 1-many type thing. Something like this:
Invoice Number 13245
Total: $1,000,000
Date Raised: 1-Jan-1989
Date Due: 1-Jan-2019
Line items:
# Desc Cost
1 Hat 23.00
2 Gloves 7.00
3 Walking Stick 999,970.00
I could use a single dataset for something this simple and then group on the 'parent' values, but usually I have multiple types of detail rows or want a graph for the detail records, or for whatever reason I want to have two datasets: one for the parent records and one for the child record.
The way I've always approached this is to base the report on one dataset, add a subreport to the report and use another dataset for the child records. This works fine and looks right - ie when I run the report I see all the data in one view, with the detail section expanded to fit all the records. However, the subreport is always clickable and that is my problem. If a user clicks on the subreport, ie on the child records or a graph or whatever it is I have there, they're taken to the subreport. It's weird to them because they then see a new 'page' which just has the details from that section on it.
What I really want is a way to have my report based off multiple datasets, just like I'm doing now with subreports, but to make it so the user can't click on those subreports and drill into them. I've never worked out how to do this. Is that because I'm just approaching it all wrong, or just a limitation of Crystal Reports, or is there a solution?
I'm using Crystal Reports that comes with Visual Studio 2005.