Click here to Skip to main content

Conditional Sum for Rdlc (aka ReportViewer)

Code for summing by group in a RDLC report
Sign Up to vote bad good
Add a reason or comment to your vote: x
Votes of 3 or less require a comment
Go to Report>Report Properties>Code and insert:
 
Public Function ConditionalResult(checkField as Field, compareValue as Object, returnValue as Field) As Decimal
    IF checkField.Value <> compareValue
        Return 0 
    else 
        Return returnValue.Value
    end if 
End Function
 
To insert the group sum, in an aggregrate field (ie, footer), add code similar to:
 
=Sum(code.ConditionalResult(Fields!Validated, true, Fields!TransactionAmount))
Posted 13 Jul '10
_Groker343


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Your Filters
Interested
Ignored
     
  1. SAKryukov (583)
  2. CRDave1988 (390)
  3. CPallini (315)
  4. Varun Sareen (308)
  1. SAKryukov (13,971)
  2. OriginalGriff (8,238)
  3. Christian Graus (7,396)
  4. thatraja (5,300)
  5. Abhinav S (5,103)

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --

Advertise | Privacy | Mobile
Web03 | 2.5.120222.1 | Last Updated 14 Jul 2010
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid