Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with report with dulpicated subreport

Status
Not open for further replies.

sparkyp

Programmer
Joined
Aug 16, 2004
Messages
12
Hello,

We have a report with several sub-reports. We wish to re-use one of them three times within the report, displaying different data each time. We have each sub-report in it's own group on the main report, each with the formula 'whilereadingrecords; 1'.

When we insert the duplicate sub-reports, they get the names 'xxx.rpt - 01' and 'xxx.rpt - 02'.

It all seems fine, but when the report is generated, all three sub-reports show the same data - and appear to be the same report. They all show the data from the last sub-report (i.e. 'xxx.rpt - 02'). If we remove that one, they both show the data from report ' - 01'.

We are setting the data with code like this (C#):

Code:
report.OpenSubreport("xxx.rpt").SetDataSource(myDataSet1);
report.OpenSubreport("xxx.rpt - 01").SetDataSource(myDataSet2);
report.OpenSubreport("xxx.rpt - 02").SetDataSource(myDataSet3);

We have parameters which display in the reports and these are appearing correctly.

Is it possible to do this in CR, or are we barking up the wrong tree?

We are using the version of CR 9 that comes with Visual Studio.

We are hoping to be upgrading to the Developer Edition soon.

Thanks for any help.
 
Click on the subreport, choose File > Save Subreport As. Use a new name, then re-import.

I've done this on both 8.5 and 10. Should work for 9.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks Madawc. This didn't work - I think the problem was the fact that it was the Visual Studio version of CR9, which I think is very limiting. We are now using the Developer Edition of XI and that has fixed the problem - we now insert the same sub-report three times and it's fine.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top