Daniel
Daniel

Reputation: 362

Visual Studio 2008 Crystal Reports Basic SUM of calculated field

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?

Upvotes: 0

Views: 953

Answers (1)

Daniel
Daniel

Reputation: 362

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).

Odd that it worked on single items, but would not sum.

Upvotes: 1

Related Questions