Custom Code

  • Hello,

    I need some help for a issue regarding custom code in SSRS.

    Below is the codes.

    ***********************************

    dim public totalCO as Decimal = 0

    Public Function AddTotal(ByVal textbox42 AS Decimal ) AS Decimal

    totalCO = totalCO + textbox42

    return textbox42

    End Function

    Public Function GetTotal()

    return totalCO

    End Function

    **************************

    In the group footer, I called =code.GetTotal() to get the sum for the group

    If report of each group is only fit into just one page. I can get correct sum value.

    However, the problem is it looks like totalCO is page specific, meaning it gets re-initialized each time when the page is changed (if reports have more than two pages).

    Thanks

    Frank

  • Hi Frank,

    Could this not be achieved using a RunningValue aggregation instead of custom code?

    If it's in the group footer you can just add the summed value each time e.g.

    =RunningValue(Sum(Fields!CO.Value), Sum, Nothing))

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply