All docs
V20.2
21.1 (EAP/Beta)
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Create a Table Report with Dynamic Columns

Design-Time

  • If you show data in a Data Grid, use a special generator class that converts the grid with all its settings into an XtraReport instance. This option is availabe for WinForms and WPF data grids.

  • If you use a table and you know what columns the report should contain, use the XRTable.ProcessHiddenCellMode property to hide columns.

Runtime

The main idea of the runtime approach is to define a Detail Band template. This band is repeated for each data source record. A control placed in a Detail Band (for instance, an XRTable) is repeated as well and creates a populated table in Print Preview. The table’s cells should be specified before the report document is generated.

The following example illustrates how to create a report with dynamic columns in code: How to use XtraReport’s multi-value parameter as a column chooser. The example uses a multi-value report parameter as a way to choose visible columns.