none
Visual Studio 2008 Crystal Reports Basic SUM of calculated field RRS feed

  • Question

  • I'm unable to perform a summary or subsummary. I placed my expression into a calculated field named Debit: "=Iif(Fields!trans_amt.Value > 0, Fields!trans_amt.Value,0)" this works. When I attempt to run a subsummary or summary with "=SUM(Fields!Debit.value) or =SUM(Fields!Debit.value, "DataSet1") it pulls #error.

    Before creating calculated fields I tried "=SUM(Iif(Fields!trans_amt.value > 0, Fields!trans_amt.Value,0)" this pulled the #error. However, the Iif statement worked fine used alone.

    What am I doing wrong here? Or is this something that the program is incapable of processing? Is there a way to just select a textbox and Sum the value of that? Like =SUM(textbox112.textbox) or something?

    Thursday, August 11, 2011 7:26 PM

Answers

  • Solution: To have the conditional formating and the aggregate work the Calculated Field created in the DataSet needed to be formated.  =CDec(Iif(Fields!trans_amt.value > 0, Fields!trans_amt.Value,0)).  Coverting into decimal then made it possible for me to Sum the fields =Sum(Fields!Debit.value).
    • Marked as answer by Daniel.MS Tuesday, August 16, 2011 2:25 PM
    Tuesday, August 16, 2011 2:25 PM