Creating Matrix Dynamically & Programatically
Hi,
Can any one share C# code to create Fast Report - Matrix - Dynamically and bind it with Data.... Currently we can only work with pre-designed reports ...
Thanks.
devoas.
Can any one share C# code to create Fast Report - Matrix - Dynamically and bind it with Data.... Currently we can only work with pre-designed reports ...
Thanks.
devoas.
Comments
In C# with FastReport assembly :
//Column 1
MatrixObject newMatrixObject = new MatrixObject();
MatrixHeaderDescriptor HeaderDescriptionColumn =new MatrixHeaderDescriptor();
HeaderDescriptionColumn.Expression = "ColumnTest"
newMatrixObject.Data.Columns.Add(HeaderDescriptionColumn);
//Row 1
MatrixHeaderDescriptor HeaderDescriptionRow =new MatrixHeaderDescriptor();
HeaderDescriptionRow.Expression = "rowTest
newMatrixObject.Data.Rows.Add(HeaderDescriptionRow);
//Cell
MatrixCellDescriptor CellDescriptor = new MatrixCellDescriptor();
CellDescriptor.Expression = "cellTest"
newMatrixObject.Data.Cells.Add(CellDescriptor);
// After call this
newMatrixObject.BuildTemplate();
// If you want, you add directly datasource
// newMatrixObject.DataSource = (DataSourceBase)myOleDbDataConnection.FindObject(crossViewFr3.DataSetName);
// Add Matrix object to DataBand
((FastReport.DataBand)myBand).AddChild(newMatrixObject);