none
I want to fix page wise total amount on last page in rdlc report? RRS feed

  • Question

  • 1-Open the report code window by clicking Report Menu-->Report Properties, and the click on the code tab

    2-Add the below code in the code-window

    Public Shared PageTotal As System.Collections.Generic.Dictionary(Of Integer, Decimal)
    Public Shared Function Total(ByVal Item As Integer, byval Amount As Decimal) As Decimal
    If PageTotal Is Nothing Then
    PageTotal = New System.Collections.Generic.Dictionary(Of Integer, Decimal)
    End If
    If Not PageTotal.ContainsKey(Item) Then
    PageTotal.Add(Item, Amount)
    End If
    Return Amount
    End Function
    Public Shared Function GetTotal(ByVal Item As Integer) As String
    if Item=1 then return ""
    Return PageTotal(Item-1).ToString()
    End Function
    

    3-On the report footer, replace your present expression with the below =Code.Total(Globals!PageNumber,Sum(Reportitems!Credit.Value))

    4-On the page header, add a text box and enter below expression =Code.GetTotal(Globals!PageNumber)

    But when we update in value after that this show old value on header.

    Please help me


    Saturday, February 15, 2020 6:13 AM

All replies

  • Hi ,

    Could you share url where have you found this code or if not , share us some comment on the code for better understanding?

    According to you subject requirement, I suggest you follow this approach to get what was desired: Running total per page in SSRS 

    Regards,
    Lukas


    MSDN Community Support Please remember to click Mark as Answer; the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 17, 2020 3:40 AM
  • Simply i need page wise total on last page like:

    Page 1 total: 45

    page 2 total:12

    page 3 total:115

    grand total: 172

    i need this type can you please help me

    Tuesday, February 18, 2020 4:07 AM