Page 1 of 1

Add DataBand in Report.BeginRender

Posted: Wed May 29, 2019 8:39 am
by ChrisHolland
I am trying to dynamically create data bands from my data within a report.
I have added the following code to the Report.BeginRender event

======================================
//Create Databand
StiDataBand dataBand = new StiDataBand();
dataBand.DataSourceName = "{SectionList}";
dataBand.Height = 0.5;
dataBand.Name = "SectionDataBand";
Page1.Components.Add(dataBand);

//Create text
StiText dataText = new StiText(new RectangleD(0, 0, 5, 0.5));
dataText.Text = "{SectionList.Name}";
dataText.Name = "SectionNameEdit";
dataBand.Components.Add(dataText);
======================================

But when I preview the report no data bands are shown.
(SectionList contains 3 items at this point)

Chris Holland
SEC Solutions Ltd.

Re: Add DataBand in Report.BeginRender

Posted: Wed May 29, 2019 1:48 pm
by HighAley
Hello, Chris.

Please, try to open the report in the Designer

Thank you.

Re: Add DataBand in Report.BeginRender

Posted: Wed May 29, 2019 1:51 pm
by ChrisHolland
I did open the report in the designer - still the same!

What was supposed to be different in the designer?

Re: Add DataBand in Report.BeginRender

Posted: Wed May 29, 2019 2:05 pm
by ChrisHolland
I have attached a small test report

Re: Add DataBand in Report.BeginRender

Posted: Tue Jun 04, 2019 10:35 am
by Lech Kulikowski
Hello,

You can add all necessary components on the page, then open code tab and use same code.
Please check the sample report in the attachment.

Thank you.

Re: Add DataBand in Report.BeginRender

Posted: Tue Jun 04, 2019 10:41 am
by ChrisHolland
Sorry but I can't see an attachment!

Re: Add DataBand in Report.BeginRender

Posted: Tue Jun 04, 2019 3:17 pm
by Lech Kulikowski
Hello,

Was attached.

Re: Add DataBand in Report.BeginRender

Posted: Mon Jun 10, 2019 9:01 pm
by ChrisHolland
Thanks all working now.

Re: Add DataBand in Report.BeginRender

Posted: Mon Jun 10, 2019 9:32 pm
by Lech Kulikowski
Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.