SSRS
Hi I Have a Report I Want to Apply Colors On that But Colors Should Not Be for Total Report and the colors should be One after the other How can i do this . Any Ideas? Thanks in Advance
January 15th, 2011 12:55am

Hi Zeelu, 1st Option: Go to the table row's BackgroundColor property and choose "Expression..." Use this expression: = IIf(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent")This trick can be applied to many areas of the report. And in .NET 3.5+ You could use: = If(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent")I just researched this question myself and thought I'd share. 2nd OPtion: Using IIF(RowNumber...) can lead to some issues when rows are being grouped and another alternative is to use a simple VBScript function to determine the color. It's a little more effort but when the basic solution does not suffice, it's a nice alternative. Basically, you add code to the Report as follows... Private bOddRow As Boolean'*************************************************************************' -- Display green-bar type color banding in detail rows' -- Call from BackGroundColor property of all detail row textboxes' -- Set Toggle True for first item, False for others.'*************************************************************************Function AlternateColor(ByVal OddColor As String, _ ByVal EvenColor As String, ByVal Toggle As Boolean) As String If Toggle Then bOddRow = Not bOddRow If bOddRow Then Return OddColor Else Return EvenColor End IfEnd FunctionThen on each cell, set the BackgroundColor as follows: =Code.AlternateColor("AliceBlue", "White", True) Option 3:If you want alternate rows to colour use the below formatIn the properties window, find the BackgroundColor property for the highlighted row and choose <Expression...>. Add the following conditional formatting statement in the Edit Expression window. =iif(ROWNUMBER(NOTHING) MOD 2 ,"SILVER","WHITE")
Free Windows Admin Tool Kit Click here and download it now
January 15th, 2011 1:43am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics