0
votes

I am making a report in SAP Crystal Reports. I made couple of header and footer "templates" which I need to switch in via C# code. Here is the thing, in my main report, I inserted one header and one footer report which are there by default and depending on parameter I need to switch them with some external "template" which is somewhere on the disc.

I know how to access the subreport via code and to change the values of the objects, but I don't know how to switch them:

ReportDocument mainReportDocument = new ReportDocument();
ReportDocument subReportHeader = mainReportDocument .Subreports["Header.rpt"];
....

Thanks in advance.

2
What's the goal of separate header and footer files? What are you trying to achieve? Different logos? Client names?craig
Yes, excaly that. Different styles, different clients etc.Ferid Š. Sejdović

2 Answers

0
votes

Try this code:

ReportDocument mainReportDocument = new ReportDocument();
ReportDocument subReportHeader = mainReportDocument .Subreports["Header.rpt"];