Reporting Services 2005 sum by rows quantity
Hi everybody!
I
can't use SQL in my query, cause i do not use database as source.
I have data like this:
Month---ToPay---Rest
---------------20200
Month1--200----20000
Month2--400----19600
->>-
Month59--300----600
Month60--600----0
I need to represent first 24 month like it is but the rest of it by years and it will be like this
Month---ToPay---Rest
---------------20200
Month1--200----20000
Month2--400----19600
->>-
Month24-400----20000
Year3---4040---8800
Year4---4040---4040
Year5---4040---0
It means that i need to have possibility to
make sum by number of rows and take it every 12 time.
It can be much more months and i have more columns in reality with different data
I maked first table with filter by 24 top elements but get stuck how to create the second table
Blessings,
Alex
December 17th, 2010 11:59am
I created a customcode like
Private SumTot
Public Function SumTotByYear(ByVal rownr As Integer, ByVal value As Object) As Object
If (rownr <= 24) Then
Return value
End If
Dim calc As Double
calc = (CDbl(rownr) - 24.0) / 12.0
If ((calc - CInt(calc)) = 0) Then
SumTotByYear = SumTot + value
SumTot = 0
Else
SumTot = SumTot + value
Return Nothing
End If
End Function
and i call it from report like that
=Code.SumTotByYear(RowNumber("PaymentPlan"),Fields!TotalPeriodPayment.Value)
It's workedbut i still have problem with empty rows and i need to repeate my funktion as many times as columns (because Sum is unique for each one)
Free Windows Admin Tool Kit Click here and download it now
December 18th, 2010 6:52pm
It seems like i solved it, but still have no idea if it the best way to do i SSRS
Empty rows was filtred in a group level
Hidden property on respektive row setted to simular functon RowIsHidden
=Code.RowIsHidden(RowNumber("PaymentPlan"))
Public Function RowIsHidden(ByVal rownr As Integer) As Boolean
If (rownr <= 24) Then
Return false
End If
Dim calc As Double
calc = CDbl(rownr)/12.0
If ((calc - CInt(calc)) = 0) Then
Return false
Else
Return true
End If
End Function
Hope ot helps somebody and i will check this message for your solutions
December 21st, 2010 7:00am