Hi, ley say I have a report with
ReportTitleBand
GroupHeaderBand
DataBand1
DataBand2
FooterBand
If I want to add a new databand between the databand1 and databand2 in code, how do i achieve it? If using page.components.add(databand) , it will add at the bottom.
Add A dataBand In the middile of report
Re: Add A dataBand In the middile of report
Hi Liewai,
There are several ways to do that.
You could have a DataBand3 placed in the page beforehand but with Enabled=false property and to set Enabled=true when required.
If you have a look to the 'Code' tab in the Designer and check the auto-generated code there, you might find the 'under the hood' behaviour of the report engine, when the report is generated, something like that;
As you mentioned, the order in which the databands are added is important in this case.
Thank you,
Edward
There are several ways to do that.
You could have a DataBand3 placed in the page beforehand but with Enabled=false property and to set Enabled=true when required.
If you have a look to the 'Code' tab in the Designer and check the auto-generated code there, you might find the 'under the hood' behaviour of the report engine, when the report is generated, something like that;
Code: Select all
this.Page1.Components.AddRange(new Stimulsoft.Report.Components.StiComponent[] {
this.DataBand1,
this.DataBand3,
this.DataBand2});
Thank you,
Edward