Skip to Content
0
Former Member
Apr 24, 2009 at 06:38 AM

Copying sections into different reports

24 Views

Hi!

This time I want to do something strange. I want to read a specific section from an u201Coriginu201D report and copy ( replace ) it to an u201Cendu201D report. Something like:

string uriOrigin = "origin.rpt";
string uriEnd = "end.rpt";

ReportDocument rdOrigin = new ReportDocument();
rdOrigin.Load(uriOrigin);

Section sOrigin = rdOrigin.ReportDefinition.Sections[0];

rdOrigin.Close();
rdOrigin.Dispose();


ReportDocument rdEnd = new ReportDocument();
rdEnd.Load(uriEnd);

rdEnd.ReportDefinition.Sections[0].ReportObjects = sOrigin;

rdEnd.Close();
rdEnd.Dispose();

But, as we know, the Sections attribute is only a getting attribute, not setting. So, I donu2019t know how to do this. Someone can help me?

(Both reports are built using Crystal Reports 11 or Crystal Reports 2008)