ASP.NET FastReport With Dynamic columns
Hi All.
I want to create report with dynamic columns in data-source (Which return from Stored Procedure or C# logic code ). Is any method help me do that from FastReport Designer. If no, anyone can provide or guide me code template to do that.
Thanks all.
I want to create report with dynamic columns in data-source (Which return from Stored Procedure or C# logic code ). Is any method help me do that from FastReport Designer. If no, anyone can provide or guide me code template to do that.
Thanks all.
This discussion has been closed.
Comments
Hello!
If the number and composition of columns in a stored procedure or DataTable change dynamically each time it runs, there are two official ways to build such a report:
In the code-free designer (MatrixObject): if the data is returned in normalized long format (RowKey, ColumnName, Value), the Matrix component will automatically build any number of columns and totals dynamically.
Programmatically using DataTable.Columns (in C# before Prepare() or in _StartReport / TableObject.ManualBuild): set table.ColumnCount = dt.Columns.Count, specify the column widths, and populate the headers and rows in a loop (table[colIdx, 0].Text = dt.Columns[colIdx]. ColumnName, or via Table1.ManualBuild with PrintRow/PrintColumns), or create a TextObject on the DataBand in a loop.