adding serial number to grouping column in SSRS Tablix
Hi All, Kindly please help me add sr.n0 to grouping column in SSRS Tablix
January 26th, 2011 2:46am

Take a look at ROWNUMBER function http://msdn.microsoft.com/en-us/library/ms159225.aspxBest Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
Free Windows Admin Tool Kit Click here and download it now
January 26th, 2011 3:15am

Hi, Please try the below 1. Open the report properties (right click on blank area outside the layout and click properties) or (Menu-->Report-->Report Properties) 2. Click on the code pane on the left 3. In the code window enter below script dim Counter as integer=0 public function getGroupCounter() as Integer Counter=Counter+1 return Counter end function 4. Go to the properties of the group (based on which group you need the group serial number) 5. Click the variables tab on the left 6. Click on Add and set Name as GroupCountValue and set the expression (in the expression window) as =Code.getGroupCounter, click ok and close the window. 7. Now in the textbox where you want to display the group number, set the expression as =Variables!GroupCountValue.Value 8. Run the report and observe the result Hope this helps. Please feel free to discuss if further help required. Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful. BH
January 26th, 2011 3:15am

Thanks alot..... Can you help me on 1more thing n,based on the grouping we did, I need to mark background colour With alternate rows showing diff colours....
Free Windows Admin Tool Kit Click here and download it now
January 26th, 2011 6:49am

Hi, Glad to note it helped you. For your background alternate color, please try below expression =iif(Variables!GroupCountValue.Value mod 2=0,"AntiqueWhite","Snow") You can use any of the preferred colors instead of the above color shown (AntiqueWhite and Snow) for example. Hope this helps Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful. BH
January 26th, 2011 7:12am

Bilal, I am trying to follow your steps above, but for me when I try to call the function (getGroupCounter) it gives an error saying "Unrecognized identifier". I am following the steps exactly as you have mentioned. Do you have any clue as to why i could be getting that error?
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2011 9:52am

I checked it again; it is working well. Make sure you are using the correct casing (upper/lower cases) in function name and in the expression that calls the function. Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful. BH
June 4th, 2011 7:58am

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

Other recent topics Other recent topics