Using conditional formatting in ASPRunnerPro projects
This example illustrates the profitability of the product line, where we have a list of products with their respective monthly profit figures.
The positive numbers are displayed in red and the negative - in black. Changing the font color of the field with negative values helps spot the losses immediately.
To set the formatting, proceed to the Page Designer, click on the field you wish to format (the profitability field in our case), then click View as/Edit as. Select View as Custom option. Add the code in the custom code editor:
You can represent positive and negative results with different images. If you want to highlight the performance of the products with images of red and green circles, place the actual images into the project folder first.
Then add two more lines to your custom code to show these images:
You may change the background of the cell to yellow, based on its value. As you are working with the table structure here, you will have to use the events.
The code is similar to the previous examples:
You can use the same condition check in the After record processed event - change the code to set the entire row yellow. Your code may look like this:
And if you want to change the background color of all rows regardless of the condition, you can simply delete the condition in this event: