How to highlight data by condition in FastReport .NET

2016-02-10

There are times when you need to highlight some of the data when analyzing tables.

Usually, when we review a paper version of the document, we highlight a data using a marker.

But why not do it at once, during the formation of the table?

FastReport .NET allows you to highlight the data depending on the specified conditions. A striking example of the use of conditional highlighting - the statistical data in the summary tables (matrices).

Let's create a matrix report. We use the data from the database nwind.xml, which is used in the demo reports of FastReport .NET. Use the table MatrixDemo.

The result here is a simple template:

If you run the report, we can see the dry statistics on the profitability of the company, brought by employees for months. But let's say we want to highlight cells with a yield of more than 3000r per month.

Select the cell [Revenue]. On the toolbar, click the icon:

In the next window you can set conditions for the highlighting and style of text or background.

Add Condition Value> 3000. Color can be a gradient or "glass".

You can add any number of conditions for the same object. Add another one: Value> 1000.

Since we have two conditions, it is necessary to take into account their order. If you move up the second condition, the cell with a value > 1000 will be yellow, as well as the value > 3000. This will happen because FastReport .NET handles the conditions in the order. Since the condition Value> 1000 covers the values > 3000, the second condition would not apply. Keep this in mind when using multiple conditions for a single object. Now let's see the result of our efforts:

If you want to highlight the columns Total, will have to add the same conditions for the cells in this column.

So, by simple manipulations we get a summary table that does not require further analysis with marker in hand.

.NET .NET FastReport FastReport
April 22, 2025

Working with the TfrShellTreeView Component in FastReport VCL

In this article, we will look at the TfrShellTreeView component. It is designed to display file system elements and is partially analogous to the TDirectoryListBox, TDirectoryOutline, and TShellTreeView components.
April 21, 2025

How RFID Tags Work in FastReport VCL

In this article, we'll check out how RFID tags work with the new TfrxDeviceCommand object in FastReport VCL with release 2025.2.
April 08, 2025

How to Set Up a Connection to Apache Ignite in FastReport .NET

In this article, we will explore how to configure a connection to Apache Ignite in FastReport .NET. You will learn the necessary steps to connect the plugin via code and the report designer.
Fast Reports
  • 800-985-8986 (English, US)
  • +31 97 01025-8466 (English, EU)
  • +49 30 56837-3928 (German, DE)
  • +55 19 98147-8148 (Portuguese, BR)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2025 Fast Reports Inc.