Hi All,
Intro: I have a very complex report. To make it a bit more easy, I build my report this way: In VS.net, I have a class. In the report I made a "Field Definitions Only"-file (ttx) which is exactly the same as the class. In code behind I set the class as the datasource of the (sub)report.
Problem: One class (and also the ttx-file) has the following fields: PriceTraditional, PriceCommercial. And there are 2 formulaFields which are SumPriceTraditional, SumPriceCommercial.
When the class is empty, the datasource is also empty. This is when the error occurs. Probably because I take a sum of a field that is NULL.
Solutions I tried (but don't work):
- I tried to change PriceTraditional with a formulaField (ex: PriceTraditionalDummy; with formula: if isnull({DamageForReport.PriceTraditional}) then 0 else {DamageForReport.PriceTraditional}. But then I get an error: A number is required here. (Which is caused by the else part of the structure.
- I tried turning on and off the default values replacing (no result)
Question: I just want to have a report where I can use that Sum-FormulaField without blowing up the report if the field used in the sum is empty.
Any advice on how to solve this would be great!!
Kind regards,
Wim