Click here to Skip to main content
Click here to Skip to main content

Conditional Sum for Rdlc (aka ReportViewer)

, 13 Jul 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Code for summing by group in a RDLC report
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 
        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))


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


About the Author


United States United States
No Biography provided

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141223.1 | Last Updated 13 Jul 2010
Article Copyright 2010 by _Groker
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid