Click here to Skip to main content
13,734,201 members
Click here to Skip to main content
Add your own
alternative version

Stats

34.3K views
5 bookmarked
Posted 13 Jul 2010
Licenced CPOL

Conditional Sum for Rdlc (aka ReportViewer)

, 13 Jul 2010
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 
    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))

License

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

Share

About the Author

_Groker
United States United States
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...

Comments and Discussions

 
QuestionYour code lacks more explanation. Pin
Member 104451664-Apr-15 9:30
professionalMember 104451664-Apr-15 9:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01-2016 | 2.8.180920.1 | Last Updated 13 Jul 2010
Article Copyright 2010 by _Groker
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid