Add DataBand in Report.BeginRender
-
- Posts: 45
- Joined: Tue May 21, 2019 1:44 pm
Add DataBand in Report.BeginRender
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.
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
Hello, Chris.
Please, try to open the report in the Designer
Thank you.
Please, try to open the report in the Designer
Thank you.
-
- Posts: 45
- Joined: Tue May 21, 2019 1:44 pm
Re: Add DataBand in Report.BeginRender
I did open the report in the designer - still the same!
What was supposed to be different in the designer?
What was supposed to be different in the designer?
-
- Posts: 45
- Joined: Tue May 21, 2019 1:44 pm
Re: Add DataBand in Report.BeginRender
I have attached a small test report
- Attachments
-
- TestReport.zip
- (2.39 KiB) Downloaded 159 times
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Add DataBand in Report.BeginRender
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.
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.
-
- Posts: 45
- Joined: Tue May 21, 2019 1:44 pm
Re: Add DataBand in Report.BeginRender
Sorry but I can't see an attachment!
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Add DataBand in Report.BeginRender
Hello,
Was attached.
Was attached.
- Attachments
-
- sample.mrt
- (4.33 KiB) Downloaded 183 times
-
- Posts: 45
- Joined: Tue May 21, 2019 1:44 pm
Re: Add DataBand in Report.BeginRender
Thanks all working now.
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Add DataBand in Report.BeginRender
Hello
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.