May 5, 2009 at 12:26 am
Comments posted to this topic are about the item Conditional formatting with Reporting Services
May 5, 2009 at 8:19 am
Glad to see the Reporting Services articles. This is a good one. Never would've thought of creating the formatting info back in the sproc...
Also nice use of the word "turgid." I had to look it up... π
May 5, 2009 at 8:36 am
An extra note, instead of typing in feild!col1.value you can use me.value and then apply the formatting to a lot of columns at once.
For example if you have several currency columns that need to be red if negative just select them all and in the color expression type iif(me.value<0,βredβ,βblackβ)
May 5, 2009 at 8:49 am
Thanks Mark - this sounds like a real timesaver.
Adam
May 5, 2009 at 10:11 am
I was thrown off by the ";" with the first 'CASE' for the Commission Flag (I had not used CASE before). I have worked with Crystal Reports for years, even though the Report Builder is not as 'friendly' in a lot of ways as Crystal. It appears it is just as flexable so far.
May 5, 2009 at 10:57 am
Oops! Sorry about the typo - the ";" in the first snippet before CASE should, of course, be a comma!
May 6, 2009 at 4:07 am
If you despise the report designer as much as I do you could even take it a step further by returning the colour codes/names by the stored proc. This way you avoid those nasty IIF statements, and the logic is kept in one place:
CASE
WHEN SP.Bonus = @Topseller THEN '#0000FF' --Blue
WHEN SP.Bonus = @Bottomseller THEN '#FF0000' --Red
ELSE '#000000' --Black
END AS TopBottomSellerColour
...or:
CASE
WHEN SP.Bonus = @Topseller THEN 'Blue'
WHEN SP.Bonus = @Bottomseller THEN 'Red'
ELSE 'Black'
END AS TopBottomSellerColour
The 'Colour' property of the textbox could then simply be set to:
=Fields!TopBottomSellerColour.Value
Chris
May 15, 2009 at 9:06 am
Another Option would be to use the "Custom Code" area in the report properties to create a routine that would return a colour based on dollar value.
This way you do not have to burden the SP with this display-ish logic.
regards
Matteo
May 19, 2009 at 8:49 am
Nice article. I do a lot of BI and KPI type reports and prefer to use a SWITCH statement on a flag instead of IIF statement:
=switch(Fields!mydata.Value = 1,"blue",
Fields!mydata.Value = 2,"green",
Fields!mydata.Value = 3,"orange",
Fields!mydata.Value = 4,"red")
Just an option I thought I'd share.
Frederick (Fred) J. Stemp, Jr.
Database Administrator / Database Developer
Dealer Funding, LLC
'...if they take my stapler then I'll set the building on fire...'
August 20, 2009 at 4:58 am
Can I have a conditional format of each "Person Name".For instant each person have got a set target, Then I want to format the "Sales YTD" to quickly see if the guys are achieving their target or not?
Please assist guys
March 25, 2010 at 9:05 am
any ideas on how to format a cell when the cell in the previous row has a different value.
March 25, 2010 at 9:10 am
What are you looking to do specifically?
If it's from a cell and you want just that value to change format on another cell in the Expression of the cell you want changed you can reference the other cell by using ReportItems!<cell name>.Value
But to really help, if you could provide an example of what you are trying to do, I maybe able to get you where you want to go π
Frederick (Fred) J. Stemp, Jr.
Database Administrator / Database Developer
Dealer Funding, LLC
'...if they take my stapler then I'll set the building on fire...'
March 25, 2010 at 9:28 am
I have a Width column. I need to change the format of the cells in the Width column.
I would like the font to be Dark Blue if the Width value in the cell is different than the Width value in the cell in the previous row.
March 25, 2010 at 10:06 am
Does the column's property allow it to auto grow? If not how are you setting the width property?
Frederick (Fred) J. Stemp, Jr.
Database Administrator / Database Developer
Dealer Funding, LLC
'...if they take my stapler then I'll set the building on fire...'
March 25, 2010 at 10:14 am
sorry, its confusing. The column value is for Width for a product. Like 12ft or 10ft or 8 ft. I want to change the font color propery of this.
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply