Haggis
10th February 2003, 16:57
Hi

I have an after.field report layout. There is just a total column in that layout which is calculated using standard baan total function. I want to supress this layout if the total is zero. I would normally do this in the layouts screen with a statement such as total.sales <> 0

But in this case I am using the baan total function. Is it still possible to put a condition in the output expression for the after.field, in the report layout that would not show the layout if the toal was zero?

Hope this makes sense?

gfasbender
10th February 2003, 18:47
When you define an aggregate field in reports, like total, the report compiler does create an internal field. You can use this field in your condition, but need to be real careful when modifying the report in the future.

Total fields have an internal declaration of Total..0, Total..1, and so on. You can compile your report in debug mode and view the generated source file, in your temp directory, to see the usage.

The cooresponding "Total..0" field can be used in your layout condition, like: Total..0 > 0

p.cole
12th February 2003, 14:52
I would not recommend using the Total..x fields. Because they are internal to the Baan report writer they may be changed at any time. They also become very confusing to use when more than one total field is in use. They are totally undocumented for anybody else looking at your code.

It may be more work, and slightly slower but I would create a total in the report script before/detail/after layouts and then use this total in the layout you wish to prevent printing.