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:
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
Create a multi-value parameter for specifying the order of the columns in the report.
```vb
=Code.GetColumnValue(1, Parameters!Order)
```
```vb
=Fields(Code.GetColumnValue(1,Parameters!Order)).Value
```