alternate colors for table in a drill down report
Hi Team, Have a problem in setting alternate colors to the drill down report developed using a table I am giving this expression in both the group and the detail rows: = IIf(RowNumber( Nothing) Mod 2 = 0, "Silver", "Transparent") working for the detailed row both not for the grouped row. some more inputs: I have state,city columns and a data cell. Drill down on state should give cities in that state. Please sujjest me something.. Regards, Eshwar.
July 29th, 2010 12:04am

Could you take a look at the links below to see if it works for you? http://social.technet.microsoft.com/Forums/en/sqlreportingservices/thread/dedbebaf-9575-41d1-be8f-23d73fbe7ab9?prof=required http://blogs.msdn.com/b/chrishays/archive/2004/08/30/greenbarmatrix.aspx Hope it helps!Thanks, Michael Mei
Free Windows Admin Tool Kit Click here and download it now
July 29th, 2010 12:35am

Hi Micheal, Thanks for youre prompt response but the first link is actually taking me to my question mean to the same page second link its for matrix i know it before... anymore suggestions!! Thanks, Eshwar
July 29th, 2010 12:40am

Try below =iif(RunningValue(Fields!State.Value & Fields!City.Value.Value, CountDistinct, Nothing) mod 2 = 0,"Silver","Transparent") Nanda - Misys Software Solutions,Bangalore
Free Windows Admin Tool Kit Click here and download it now
July 29th, 2010 12:46am

Hi User_SQLServer, If I understand correctly, you have a table, which has a group with group header, and has detailed rows. Now, you want to alter color for both the grouped rows and the detailed rows. For example: Group Header Color1 Detailed Row Color2 Detailed Row Color1 Group Header Color2 Detailed Row Color1 Detailed Row Color2 Since the execution order is undocumented, and is not the one as we thought (group header then detailed rows), the RowNumber won't return in ordered number. So, the alter color won't work. Just based on my testing, the RowNumber(Nothing) in the group header will return the row number of the last row of the current group. There are two possible workarounds for your reference: 1. Use the RowNumber and the RunningValue function to work around the issue. For the grouped header, please use this expression: =IIF((ROWNUMBER(Nothing) - CountRows("Group1") + RunningValue(Fields!SalesPersonID.Value, CountDistinct, Nothing)) MOD 2 = 0, "Silver", "Transparent") Note: The "Group1" is the group name of the current group. The field SalesPersonID is the field the group used to group by. For the detailed rows, please use this expression: =IIF((ROWNUMBER(Nothing) + RunningValue(Fields!SalesPersonID.Value, CountDistinct, Nothing)) MOD 2 = 0, "Silver", "Transparent") 2. Use the custom code to construct an ordered number. a) Embed the following code in the report Dim Aggregation as Decimal Function AddValue(ByVal NewValue As Decimal) as Decimal Aggregation = Aggregation + NewValue Return Aggregation End Function Function GetAggregation () as object GetAggregation = Aggregation Return GetAggregation End Function b) Set the following expressin the both the grouped header and the detailed rows. =code.addvalue(1) c) For the backgroupcolor expression, please use this expression: =IIF(code.GetAggregation() MOD 2 = 0, "Silver", "Transparent") If there is anything unclear, please feel free to ask. Thanks, Jin Chen Jin Chen - MSFT
July 30th, 2010 4:02am

Hi Jinchun, In the first workaround, the group header expression: =IIF((ROWNUMBER(Nothing) - CountRows("Group1") + RunningValue(Fields!SalesPersonID.Value, CountDistinct, Nothing)) MOD 2 = 0, "Silver", "Transparent") was not working in my drilldown report. I modified it by replacing ROWNUMBER(Nothing) to ROWNUMBER("Group1") as follows. =IIF((ROWNUMBER("Group1") - CountRows("Group1") + RunningValue(Fields!SalesPersonID.Value, CountDistinct, Nothing)) MOD 2 = 0, "Silver", "Transparent") and that is now working fine. There is no change in detail level expression given by Jinchun. Your solution was of great help to start with. Thank you.
Free Windows Admin Tool Kit Click here and download it now
October 9th, 2012 6:01am

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

Other recent topics Other recent topics