For the complete documentation index, see llms.txt. This page is also available as Markdown.

Conditional Formatting

This chapter describes how you change the look of a report element depending on the data, e.g. a colored background for Not-Placed Objects.

In the Report Designer you bind a property of an element, like the background color, to an expression. The expression is calculated for each record.

Set an Expression

Open the Report Designer with Edit report layout... and select the element, e.g. a table cell in the Detail band. In the Properties panel you see the symbol ƒ right of each property. A bold ƒ shows that the property already has an expression. Click on the ƒ right of Background Color. It is on the Appearance tab.

The Expression Editor opens. On the left you see the properties of the element, the selected one is Background Color. Enter the condition with the function Iif. Iif checks the conditions one after the other and returns the value of the first condition which is true. The last value is used if no condition is true.

The standard reports "PID Valvelist", "PID Instrumentlist" and "PID Equipmentsheet with Nozzles" use this expression for the background color:

Graphical Not-Placed Objects (GNPO) get a green background, Non-Graphical Not-Placed Objects (NGNPO) a blue one. The ? at the end means: no change, the cell keeps its normal background.

Repeat this for every cell of the row which should get the color.

The column ACP_ObjectType contains PO for placed objects and GNPO or NGNPO for Not-Placed Objects. Not-Placed Objects are only part of the report if the query includes them. See Include Not-Placed Objects.

The same works with other properties, e.g. the text color, the font, or the visibility of an element. More examples can be found in the DevExpress documentation.

Remark: The colors of a comparison of versions/revisions are set by PlantReporter itself. See Compare Versions/Revisions.

Last updated