Posted 22 January 2021, 4:36 pm EST - Updated 30 September 2022, 4:50 pm EST
I have a report consisting of mostly dynamically-generated columns - only three are defined in the report while possibly dozens could be generated at runtime. The code below generates them, with totalNames being populated from a DataTable of unique column names. I just loop through the list and add them to the first (header) section:
List<string> totalNames = new List<string>();
for (int i = 0; i < totalNames.Count - 1; i++)
{
ctl = new GrapeCity.ActiveReports.SectionReportModel.Label();
ctl.Name = "header1" + i.ToString();
ctl.Location = new PointF(left + (i * 0.3f), 0.8f);
ctl.Size = new SizeF(0.3f, .3f);
ar.Sections[0].Controls.Add(ctl);
}
This works, but my issue is that if there are more than about twenty columns (and this is very likely), they run off the screen and are no longer visible. Is there a way to tell the report to split the columns across pages, so if the number of columns exceeded a certain count (i.e. 20 columns), then the remaining columns would appear on the second page?
I had been experimenting with the blog post at https://www.grapecity.com/blogs/generate-columns-at-runtime-in-activereports, and that did show me how to properly generate the columns. I was not able to successfully duplicate splitting the columns across pages. This may be something I had done wrong, or that the example project is ten years old and is a Windows Form project, while I am using WPF.