Example 3. Data filtering |
Top Previous Next |
In this example, we will show how to hide the "Data" band row depending on the given conditions. We will be using:
Create a simple report having the following appearance:
Create a BeforePrint event handler for the band:
private void Data1_BeforePrint(object sender, EventArgs e) { if (((Decimal)Report.GetColumnValue("Products.UnitPrice")) > 20) Data1.Visible = false; }
In the given case, the band rows which have the unit price > 20 will be hidden:
The same effect can be achieved by using the data filter which can be set in the "Data" band editor.
|