posted 9/9/2010 by SMcDonald - Views: [906]
When creating a report, it's nice to add color to it, especially when attempting to separate the rows. Here is a quick how to for you:
1. After you create your report, highlight one of your rows:
2. Go to your properties window, find the Background Color field and click the drop down box:
3. Click the Expressions link at the bottom:
4. In the Expressions box type: =IIF(ROWNUMBER(
=IIF(ROWNUMBER(
NOTHING) MOD 2=0,"LightGrey","White")
5. After you have applied this change and you preview your report, you should see results like the one below:
Spruce it up if you want by choosing different colors. This will get you started. Enjoy your week!
For those using SSRS to deliver reports where users save to MS Excel, I would caution which colors are used for the alternating colors. While the varying grey choices seem to look wonderful in a browser, the color itself may not save well to MS Excel. Note, this is based mainly on MS Excel 2003, so newer versions may be okay with keeping the alternating colors.
With that said, I recommend Silver and White:
=IIF(RowNumber(Nothing) Mod 2, "Silver", "White")
Just two cents...
Great post Sherri! I have found this very useful several times while writting reports. One thing that users should be aware of is that this doesn't work perfectly in a table or matrix if you are grouping the rows. If that is the case you can try this expression instead : =IIf( RunningValue (Fields!FieldName, CountDistinct, Nothing) MOD 2, Color1, Color2) and just substitute the Fields!FieldName for the first field in the report and then it should work fine. I just did this today as a matter of fact.