xorpower
xorpower

Reputation: 19003

Formula to Sum "amount" column in Crystal report

I have a column name as "Amount" in CR. I need to sum that column.

I created a new formula and tried sum( { MycolumnName} ) and it says

"A number field or currency amount field is required here"

Is there any way to apply conversion in formula itself.

Upvotes: 0

Views: 36259

Answers (2)

Rathnakar Pydipitla
Rathnakar Pydipitla

Reputation: 11

Change the type xs:string to xs:decimal of the column MycolumnName in xs:element in .xsd page

Upvotes: 1

Why create a formula when you can just create a summary field by selecting your column and going to the menu and selecting Insert Summary, Insert Subtotal or Insert Grand Total depending on your needs? You can place the summary field in a group section as a subtotal, or in the report footer as a grand total.

If you need to apply a conversion in the formula, you can use CCur like this:

sum( CCur({ MycolumnName}) ) 

More information on converting types in Crystal Reports can be found here.

Upvotes: 5

Related Questions