Wednesday, March 7, 2012

Conditional formatting on a text box

Hi all -
I have a report that I need to duplicate in RS. What I'm trying to do is put
some conditional formatting on my detail textboxes.
I want the text to be bold if the field = certain things. ie. If the line
detail on the report = "Invoiced Sales", "Trade Sales", "Net Sales"..etc I
need that line to be bolded.
I'm trying to use an IIF statement as an expression for the textbox's
Format/FontWeight property, but am having trouble compiling.
Here's what I've tried:
=IIF(Fields!linedetail.Value = "NET INCOME", fontweight = BOLD, fontweight = NORMAL)
=IIF(Fields!linedetail.Value = "NET INCOME", BOLD, NORMAL)
Of course, I will eventually need to convert this into some kind of OR
statment because there are 7 different possible line details that should be
bolded.
I appreciate any help you could give. Thanks in advance!
-KellyHi Kelly
I have found the following works.
= iif(rtrim(Fields!ObjectCode.Value) = "Your text", "Bold","Normal")
But is has to go in the "FontWeight" property area.
"Kelly" wrote:
> Hi all -
> I have a report that I need to duplicate in RS. What I'm trying to do is put
> some conditional formatting on my detail textboxes.
> I want the text to be bold if the field = certain things. ie. If the line
> detail on the report = "Invoiced Sales", "Trade Sales", "Net Sales"..etc I
> need that line to be bolded.
> I'm trying to use an IIF statement as an expression for the textbox's
> Format/FontWeight property, but am having trouble compiling.
> Here's what I've tried:
> =IIF(Fields!linedetail.Value = "NET INCOME", fontweight = BOLD, fontweight => NORMAL)
> =IIF(Fields!linedetail.Value = "NET INCOME", BOLD, NORMAL)
> Of course, I will eventually need to convert this into some kind of OR
> statment because there are 7 different possible line details that should be
> bolded.
> I appreciate any help you could give. Thanks in advance!
> -Kelly
>
>|||For more complex conditionals you can use switch() in place of an iif(). For
example:
=Switch(Fields!linedetail.Value="Trade Sales", "Bold",
Fields!linedetail.Value="Invoiced Sales", "Bold",
Fields!linedetail.Value="Net Sales", "Normal")
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Fiona Harrison" <FionaHarrison@.discussions.microsoft.com> wrote in message
news:9E52BF14-C73D-4C2F-ABC7-5844C6ABBE19@.microsoft.com...
> Hi Kelly
> I have found the following works.
> = iif(rtrim(Fields!ObjectCode.Value) = "Your text", "Bold","Normal")
> But is has to go in the "FontWeight" property area.
> "Kelly" wrote:
>> Hi all -
>> I have a report that I need to duplicate in RS. What I'm trying to do is
>> put
>> some conditional formatting on my detail textboxes.
>> I want the text to be bold if the field = certain things. ie. If the line
>> detail on the report = "Invoiced Sales", "Trade Sales", "Net Sales"..etc
>> I
>> need that line to be bolded.
>> I'm trying to use an IIF statement as an expression for the textbox's
>> Format/FontWeight property, but am having trouble compiling.
>> Here's what I've tried:
>> =IIF(Fields!linedetail.Value = "NET INCOME", fontweight = BOLD,
>> fontweight =>> NORMAL)
>> =IIF(Fields!linedetail.Value = "NET INCOME", BOLD, NORMAL)
>> Of course, I will eventually need to convert this into some kind of OR
>> statment because there are 7 different possible line details that should
>> be
>> bolded.
>> I appreciate any help you could give. Thanks in advance!
>> -Kelly
>>

No comments:

Post a Comment