Add DataBand in Report.BeginRender
Posted: Wed May 29, 2019 8:39 am
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.