Search results
Suggest a FeaturePDF

How to create report with dynamic columns or variable columns

Change the Report column’s order or presence based on specific conditions and parameters by using the code modules. This option enhances the flexibility and customization of the report column as users can control the report layout.

To create dynamic columns in your report, follow these steps:

  1. Using the code modules, define a function that returns the order columns value for a specific column based on a given parameter value and order name. The following is an example of a VB function that does this.

    Public Function GetColumnValue(ByVal columnNum as Integer, ByVal parameter as Parameter) as String
        Return parameter.Value(columnNum-1)
    End Function
  2. Create a multi-value parameter for specifying the order of the columns in the report.

DynamicColumn

  1. Specify the column names in the default section of this parameter for the table column order.

DynamicColumn

  1. Set the table’s header row expression using the code module as shown in the following image.

HeadersColumnExpression

```vb
=Code.GetColumnValue(1, Parameters!Order)
```
  1. Set the expression for the details row in the table using the code module as shown in the following image.

DetailsColumnExpression

```vb
=Fields(Code.GetColumnValue(1,Parameters!Order)).Value
```
  1. The output will now be ordered based on the provided order sequence parameter.

DynamicColumn

DynamicColumn

Having trouble getting help?
Contact Support
Having trouble getting help?
Contact Support