Trouble viewing images? Click on images to enlarge.
In this article we cover conditional formatting at the Group / Report level inside Finished Reports.
How does it work?
When using the expression editor for a property such as Visible or Foreground Color at a group level, we need to be able to use group sums (sumSum(), sumMax(), etc.) which are not available inside the Expression Editor for properties. This means we have to change the method slightly to get the results we are looking for.
In order to accomplish this, we need to use group aggregates inside the Expression Editor for the property we want to change. If you have not been exposed to group aggregates before, it is recommended to check out our article.
How to apply Group / Report Level Conditional Formatting
1. Open/Create your View and run it. Then go into the Finished Reports Designer.
2. Make sure the report is grouped. This will be the field used in the expression
3. Add your labels to the Group Header / Footer. Set the Summary to Group.
4. Click on your label and go to the property you want to set the expression on. This example uses Foreground Color and Visible.
5. Create the expression you want to use in the expression editor using group aggregates. This example uses two forms of the same expression. One to set the Foreground Color of a label and one to set the Visible property.
Foreground Color Expression: Iif([[EmployeeID] == [^.EmployeeID]].Sum([Freight]) > 9000,'True','False')
Visible Expression: Iif([[EmployeeID] == [^.EmployeeID]].Sum([Freight]) > 9000,'Green','Red')
If we look at EmployeeID 3 and 4... these are the only two that meet the true condition in the expression. This shows that when the expression is true, the text color is green and displayed.
If you would like to run this sample View yourself, you can download it below. This View is Saved with Data.