Dynamic Behavior to Reports using Microsoft ReportViewer


Below is the pictorial explanation.

1. It shows an RDLC file with a field where dynamic behavior is required.

After selecting the desired field and going to it's Properties, click on the value options for Color.

Click on <Expression...>

2. A Modal Window appears as: Put your code as in below. And, click OK.

Here, the desired behavior is to have field color as Red for Values < 1 and color as Green otherwise.

So, the code becomes:

=IIf(Fields!Item.Value < 1, "Red", "Green")

3. That's it. RUN your report and test.

Output Report:

This is just an example to open the horizon for vast possibility of Dynamic Behavior that can be added in the Report.

Up Next
    Ebook Download
    View all
    Learn
    View all