add databand at runtime?

Stimulsoft Reports.NET discussion
Post Reply
abi
Posts: 55
Joined: Mon Feb 22, 2010 4:18 pm
Location: indo

add databand at runtime?

Post by abi »

hi,

how can i add dynamic databand on report? can i see sample project?

thx
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

add databand at runtime?

Post by Alex K. »

Hello,

Use the following code:

Code: Select all

StiReport report = new StiReport();
report.Load(@"D:\Report.mrt");
Stimulsoft.Report.Components.StiDataBand DataBand1 = new Stimulsoft.Report.Components.StiDataBand();
DataBand1.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0.4, 19, 0.76);
DataBand1.Name = "DataBand11";
Stimulsoft.Report.Components.StiPage page1 = report.GetComponents()["Page1"] as Stimulsoft.Report.Components.StiPage;
DataBand1.Page = page1;
DataBand1.Parent = page1;
page1.Components.AddRange(new Stimulsoft.Report.Components.StiComponent[] {DataBand1});
report.Dictionary.Synchronize();
report.Design();
Thank you.
Post Reply