Sum in a textbox

I am using Designer of FastReport.NET Community and trying to make a sum between 2 numeric fields like this:

[field1] + [field2] but what I get is just a concatenation of the 2 values.


Just to be clear:

If field1 = 200 and field2 = 300 I just get :

200300 and not 500.

I set the format of the cell to number but the result is the same.

Comments

  • Make sure that field1 and field2 is numerical type like int32 and not string.

  • Thank you, Anatoly.

  • Hello!

    Open Dictionary in the designer and change the DataType for field1 and field2 from System.String to System.Int32 or System.Decimal.

    Alternatively, explicitly convert the values in the expression:

    [ToDecimal([Table.field1]) + ToDecimal([Table.field2])]

This discussion has been closed.