﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Adam Aspin  / Conditional formatting with Reporting Services / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 09:26:51 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>What if I am calculating sum of values in a matrix and then based on the results would like to find out the max or min and not from the main select query itself ? I guess an example scenario will be useful , if Yes please let me know and I'll provide one...</description><pubDate>Wed, 12 May 2010 10:30:25 GMT</pubDate><dc:creator>sandipan.chanda</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>No worries :)  We can do this like this:1.  In the properties of the column you want the color chnage to occur, go to Appearance | BackgroundColor and select the drop down &amp;lt;Expression...&amp;gt;.  Then you'd do something like this for a Table:=swithch(isnothing(Fields!Width.Value) = 0, "transparent",Fields!Width.Value = &amp;lt;your value/threshold&amp;gt;, "green",Fields!Width.Value = &amp;lt;your value/threshold&amp;gt;, "yellow",Fields!Width.Value = &amp;lt;your value/threshold&amp;gt;, "red")You may not need a IsNothing statement but I provided one just in case your dataset does return NULL values.  Now the Fields!Width.Value can use other aggregates like &amp;lt;&amp;gt;, &amp;lt;, &amp;gt; , =.  You can also Use OR and AND statements if you want to set the condition to look at two different columns.  You can also use IIF instead of SWITCH.  My preference is SWITCH because nesting IIF statements can get confusing :)In a Matrix you should/may need to use an aggregate like SUM, AVG, MIN and so forth before Fields!Width.ValueI hope that is of some help. :)  Let me know if I can help more!</description><pubDate>Thu, 25 Mar 2010 10:38:56 GMT</pubDate><dc:creator>Fred Stemp</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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.</description><pubDate>Thu, 25 Mar 2010 10:14:36 GMT</pubDate><dc:creator>stacey doran</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>Does the column's property allow it to auto grow?  If not how are you setting the width property?</description><pubDate>Thu, 25 Mar 2010 10:06:30 GMT</pubDate><dc:creator>Fred Stemp</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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.</description><pubDate>Thu, 25 Mar 2010 09:28:47 GMT</pubDate><dc:creator>stacey doran</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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!&amp;lt;cell name&amp;gt;.ValueBut 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 :)</description><pubDate>Thu, 25 Mar 2010 09:10:54 GMT</pubDate><dc:creator>Fred Stemp</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>any ideas on how to format a cell when the cell in the previous row has a different value.</description><pubDate>Thu, 25 Mar 2010 09:05:29 GMT</pubDate><dc:creator>stacey doran</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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</description><pubDate>Thu, 20 Aug 2009 04:58:29 GMT</pubDate><dc:creator>pitso.maceke</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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.</description><pubDate>Tue, 19 May 2009 08:49:34 GMT</pubDate><dc:creator>Fred Stemp</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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.regardsMatteo</description><pubDate>Fri, 15 May 2009 09:06:07 GMT</pubDate><dc:creator>Matteo-317581</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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:CASEWHEN SP.Bonus = @Topseller THEN '#0000FF' --BlueWHEN SP.Bonus = @Bottomseller THEN '#FF0000' --RedELSE '#000000' --BlackEND AS TopBottomSellerColour...or:CASEWHEN SP.Bonus = @Topseller THEN 'Blue'WHEN SP.Bonus = @Bottomseller THEN 'Red'ELSE 'Black'END AS TopBottomSellerColourThe 'Colour' property of the textbox could then simply be set to:=Fields!TopBottomSellerColour.ValueChris</description><pubDate>Wed, 06 May 2009 04:07:23 GMT</pubDate><dc:creator>Chris Howarth-536003</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>Oops! Sorry about the typo - the ";" in the first snippet before CASE should, of course, be a comma!</description><pubDate>Tue, 05 May 2009 10:57:10 GMT</pubDate><dc:creator>Adam Aspin</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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.</description><pubDate>Tue, 05 May 2009 10:11:05 GMT</pubDate><dc:creator>kevlray</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>Thanks Mark - this sounds like a real timesaver.Adam</description><pubDate>Tue, 05 May 2009 08:49:01 GMT</pubDate><dc:creator>Adam Aspin</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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&lt;0,”red”,”black”)</description><pubDate>Tue, 05 May 2009 08:36:51 GMT</pubDate><dc:creator>markmeiller</dc:creator></item><item><title>RE: Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>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...  :-)</description><pubDate>Tue, 05 May 2009 08:19:49 GMT</pubDate><dc:creator>Bob Griffin</dc:creator></item><item><title>Conditional formatting with Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic709928-1497-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Reporting+Services/66247/"&gt;Conditional formatting with Reporting Services&lt;/A&gt;[/B]</description><pubDate>Tue, 05 May 2009 00:26:23 GMT</pubDate><dc:creator>Adam Aspin</dc:creator></item></channel></rss>