locked
SSRS group total and grand total of group total issue RRS feed

  • Question

  • User88744855 posted

    my report group based. only three group is coming. i just want to show group total at end of each group and grand total of all the group at the report end.

    so i wrote a function like

    Dim public totalPercentage as Double
    Dim public Grptotal as Double
    
    Public Function CalculateTotal(ByVal SaleOUR AS Double,ByVal Warranty AS Double) AS Double
    
    Grptotal=IIF(SaleOUR > 0 , Math.Round(Warranty * 100 \ SaleOUR,2)  ,0)
    
         totalPercentage = totalPercentage + Grptotal
    return Grptotal
    End Function
    
    Public Function GroupGrandTotal()
    return totalPercentage
    End Function 


    i call this two function like . first at group footer level

    =Code.CalculateTotal(SUM(Fields!SALE_OUR.Value, "GrpCatagoryName"),SUM(Fields!WARRANTY_WARRANTYOUR.Value, "GrpCatagoryName"))

    and at the end row for group grand total
    =Code.GroupGrandTotal()

    the problem is group grand total is not right. i guest that grand total is not showing right value because each group is not coming in same page. so how to fix this problem when report has multiple pages and where there are many group.

    Tuesday, August 14, 2012 10:38 AM

Answers

  • User-59962394 posted
    Hi I recently started reporting with SSRS. I had the same requirement and I did it with some formula inside the textbox itself. I don't understand why are you trying to write seperate functions when you can calculate directly. You can refer the below links to see how you can do it from SSRS http://msdn.microsoft.com/en-us/library/dd255256.aspx#DataScope http://stackoverflow.com/questions/11730073/grand-total-value-doesnt-match-with-top-n-filtered-values-in-ssrs http://stackoverflow.com/questions/10095784/ssrs-group-total-by-grand-total Please explain why are you doing it in different way if there is any reason. Thanks.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 14, 2012 11:47 AM