Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Conditional formatting with Reporting Services Expand / Collapse
Author
Message
Posted Tuesday, May 5, 2009 12:26 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Saturday, December 6, 2014 9:55 AM
Points: 81, Visits: 908
Comments posted to this topic are about the item Conditional formatting with Reporting Services
Post #709928
Posted Tuesday, May 5, 2009 8:19 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, October 20, 2014 6:48 PM
Points: 1,136, Visits: 699
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...
Post #710256
Posted Tuesday, May 5, 2009 8:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 19, 2011 11:57 AM
Points: 8, Visits: 83
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”)
Post #710283
Posted Tuesday, May 5, 2009 8:49 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Saturday, December 6, 2014 9:55 AM
Points: 81, Visits: 908
Thanks Mark - this sounds like a real timesaver.

Adam
Post #710309
Posted Tuesday, May 5, 2009 10:11 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, March 27, 2012 9:05 AM
Points: 786, Visits: 161
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.

Post #710429
Posted Tuesday, May 5, 2009 10:57 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Saturday, December 6, 2014 9:55 AM
Points: 81, Visits: 908
Oops! Sorry about the typo - the ";" in the first snippet before CASE should, of course, be a comma!
Post #710477
Posted Wednesday, May 6, 2009 4:07 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, December 16, 2014 4:44 AM
Points: 290, Visits: 1,082
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
Post #710911
Posted Friday, May 15, 2009 9:06 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 1:18 PM
Points: 14, Visits: 69
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
Post #718001
Posted Tuesday, May 19, 2009 8:49 AM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 6:58 AM
Points: 18, Visits: 150
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
Southern Insurance Underwriters, Inc.

'...if they take my stapler then I'll set the building on fire...'
Post #719925
Posted Thursday, August 20, 2009 4:58 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, February 21, 2014 1:26 PM
Points: 51, Visits: 213
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
Post #774109
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse