Records in colors in RDL

2019-06-14 04:33发布

问题:

I facing some problem while creating RDL report. I want on certain condition some records to be shown in red colors in Report.as well as in execl when i export that report in excel. Can any one plz help me to do this..? Iam using Reporting server 2005.

回答1:

To do this you'll generally use a conditional expression in the "Color" property (or the "BackgroundColor" property) of the table cell(s) you want to change.

To change the text colour of a cell based on the value of the field "Price", for example, in the Report Designer, you'd select the cell, click on the "Color" property drop-down in the Properties window, then choose "Expression". Then enter an expression like:

=iif(Fields!Price.Value >= 5000, "Red", "Black")

...where "Red" and "Black" match up with colour names in the list available from the Color property list. That'll turn any price over 5,000 red, and leave the others as black.