April 10, 2012 at 5:48 am
I have a matrix Top 100 report (SQL Server 2008) where I want to add a coluimn with number 1 to 100. The problem is that since the report is filtered I can't use RowNumber, CountRows etc. to add this number (problems with nested aggregated functions)
In SQL Server 2008 R2 I have solved this bu using the expression "RunningValue(IIf (CountRows() > 0, 1, 0),sum, Nothing )", but this is not possible due to the nested aggregated functions before 2008 R2.
Someone have another solution to this problem?
April 12, 2012 at 4:16 am
you have to write Custome code and call it from the Column.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Public Shared Dim v_Rownum as Integer = 0
// Call this function from the Coumn by using Expression
Public Function GetRowCounter() as Integer
v_Rownum = v_Rownum +1
return v_Rownum
End function
// To reset Row Counter . Call this function at the Strating of the Report.
Public Function str_ResetRowCounter() as String
v_Rownum = 0
return ""
End Function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
April 13, 2012 at 1:48 am
Thanks!
I will check this. I haven´t used custom code - got any hints of handle thie custome code - where to add calls etc?
April 13, 2012 at 8:52 am
April 20, 2012 at 5:17 am
Hi, and thanx!
I'm close now. My problem is that when I go to next page tha calculation of rowno adds up, and when I go back to the first page it continues to add up.
I guess the problem is that I don't know where to add the reset call perhaps?
/ Christofer
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply