I'm trying to generate an RDLC report where one column, Amount, is going to have a "Total" row at the bottom. This isn't weird stuff, it's a very basic RDLC report, but instead of getting the normal "Total" value at the bottom I get something else, allow me to demonstrate:
It shouldn't say 97,140.00, it should say 971,40 so I'm a bit confused. The column is summarized like this:
=Sum(CDec(Fields!Amount.Value))
I have to convert it first for some reason otherwise I get an #Error instead of the wrong number. This is weird as well as the model property is a decimal and the DataTable property I'm using is a decimal.
My only guess is that it has something to do with me being swedish and using comma as decimal separator instead of a period.
The problem is obviously in CDec function. If you are sure that there is no other way for not using CDec try this: CDec(Sum(Fields!Oil_Gas.Value)) or this: FormatNumber(CDec(Sum(Fields!Oil_Gas.Value)),2) or this: FormatNumber(Sum(Fields!Oil_Gas.Value),2)
I couldn't really reproduce your problem but all mentioned solutions works for me.
This solution worked for me. Try this
=ROUND(Sum(Fields!Outros.Value, "DataSet1"),2)
Solved problem as the error was in the datatable. As I was generating the datatable to throw in I didn't set the DataColumn type, so they all defaulted to string. For some reason CDec() and FormatNumber() didn't work even though they were handled as string by the datatable.
Anyhow, after properly creating the datatable with the correct data types for each column it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With