Get Components of an existing report and add it into a new report

Stimulsoft Reports.NET discussion
Post Reply
Liewai25
Posts: 5
Joined: Mon Jun 25, 2018 2:47 pm

Get Components of an existing report and add it into a new report

Post by Liewai25 »

Can i achieve this? For instance i Have a report called reportA and reportA consist of one dataBand.

Can i take the databand out using GetComponents()["DataBand"] method and add it into a new generate report using page.Components.Add(DataBand) ? I try but fail when report generation? Is that possible.

StiDataBand d1 = reportA.GetComponents()["DataBand"] as StiDataBand;

StiReport reportTest = new StiReport();
StiPage page = reportTest.Pages[0];
page.Components.Add(d1);
Liewai25
Posts: 5
Joined: Mon Jun 25, 2018 2:47 pm

Re: Get Components of an existing report and add it into a new report

Post by Liewai25 »

Anyone? Is that possible or No ? As i cant make it and always get exception.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Get Components of an existing report and add it into a new report

Post by Lech Kulikowski »

Hello,

In this case, you should set datasource and other properties for band in second report.

Please send us a simple project which reproduces the issue for analysis.

Thank you.
Post Reply