Hello,
I want to change the width of columns of a CrossTable depending of the bound data. I know how to change the columns but I do not know at what time I can do that. My report gets its data via object data source set from outside of the report as my following code shows:
01.var reportModel = new MainReportModel()02.{03. Orders = _GetOrders()04.};05. 06.ObjectDataSource objectDataSource = new ObjectDataSource();07.objectDataSource.DataSource = reportModel;08. 09.var report = new Report1();10.report.DataSource = objectDataSource;11. 12.InstanceReportSource instanceReportSource = new InstanceReportSource();13.instanceReportSource.ReportDocument = report;14. 15.ReportProcessor reportProcessor = new ReportProcessor();16.RenderingResult renderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, null);17. 18.File.WriteAllBytes("test.pdf", renderingResult.DocumentBytes);
For design time I added an ObjectDataSource of type Order to the CrossTable. So I can use the expression designer for example. For render time I added a binding to my CrossTable to bind DataSource to the Orders property of MainReportModel.
Where can I hook into the process to get the bound data and change the CrossTable columns?
Greetings from Germany,
Tobias