Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to modify an expression in the RDLC file for a column value. I can't seem to find many examples of how to use 2 expressions together, or I'm not understanding the expression syntax

So I have a column called FPROFIT and I'm using the expression dialog editor.
Line 1 says to state the value from my dataset in which I understand.
But I want to change the color of the text to red if the value is negative.
=Fields!FPROFIT.Value

So this is the example give for it
=IIf(Fields!FPROFIT.Value <=100, "Red", "Black")

Am I suppose to use to lines, line 1 and line 2, or combine them together?
Posted

1 solution

I assume you're looking at the documentation on TechNet?
http://technet.microsoft.com/en-us/library/ms156400%28v=sql.100%29.aspx[^]

Your first expression needs to be set as the text of the TextBox. The second expression needs to be set against the Color property of the TextBox.

You need to:
  1. click on the report item you want to modify;
  2. open the properties pane (if it isn't visible);
  3. select the "Color" property in the properties window;
  4. in the drop-down, select the Expression... option;
  5. enter your IIF(...) expression in the "Edit Expression" box;
 
Share this answer
 
Comments
jkirkerx 7-Jul-14 16:43pm    
Oh I get it now.

I put the value expression in the textbox where the value goes, the placeholder
and put the color expression in the textbox property font color expression to toggle the color.

2 different expressions in 2 different places

I would of never thought of that, but makes sense now.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900