Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
Show how to create variable (dynamic) grouping in Finished Reports by using parameters and calculated expressions, allowing users to change grouping behavior at runtime.
What / Why – Variable Grouping
What: Variable grouping allows a report to dynamically group data based on a user-selected parameter (such as EmployeeID, OrderDate, or City).
Why: This provides flexibility by letting users change how data is grouped without needing multiple reports or redesigning the report layout.
Configuration Note
| Item | Details |
|---|---|
| Sample data | This guide uses the Northwinds sample database. |
| Parameter type | Parameters used for variable grouping should typically be String data types. |
| Grouping logic | Grouping is controlled through a calculated field using logical expressions. |
Use Case
| Scenario | Description |
|---|---|
| Flexible reporting | Allow users to switch grouping fields at runtime. |
| Fewer reports | Replace multiple static grouped reports with one dynamic report. |
| User-driven views | Let users control how data is summarized and displayed. |
Steps to Set Up Variable Grouping
Step 1: Add a Parameter
Open the Parameters tab
Click Add Parameter
Step 2: Configure the Parameter
Set the following properties:
Datatype: String (recommended)
Description: User-friendly label (optional)
Name: Internal parameter name
Type: Combobox
Step 3: Define Parameter Values
Open the Values List and enter the values that will control grouping.
Example values:
EmployeeID
OrderDate
City
Click OK when finished.
Step 4: Add a Calculated Field
Open Finished Reports
Right-click the Details field list
Select Add Calculated Field
Step 5: Edit the Calculated Field Expression
Right-click the new calculated field and select Edit Expression.
Step 6: Create the Variable Grouping Expression
Enter an expression using nested Iif() statements.
Each parameter value maps to a different field.
Example Format:
Iif([Parameter] = 'one', Field_One,
Iif([Parameter] = 'two', Field_Two,
'else'))
Example Expression:
For every additional grouping option, add another nested Iif() condition.
Step 7: Group Using the Calculated Field
Open Group and Sort
Click Add a Group
Select the new calculated field as the grouping field.
Step 8: Run the Report with Different Parameters
Search the View, select a grouping parameter, then open Finished Reports to preview results.
Variable Grouping Examples
Grouped by EmployeeID:
Grouped by OrderDate:
Grouped by City:
Article Summary
This article explains how to implement variable grouping in Finished Reports using parameters and calculated expressions. By combining a combobox parameter with a calculated field and grouping on that field, users can dynamically change how report data is grouped at runtime. This approach reduces report duplication, increases flexibility, and gives users more control over how information is presented.
Comments
1 comment
I think this may need an update, there is no longer an option to right click parameters on the finished reports designer.
Please sign in to leave a comment.