renam9
26th January 2006, 21:45
I have written a custom report in Baan but when it prints, if the layout doesn't fit on the page it will repeat itself on the next page. This causes my report totals to be incorrect because the report re-adds the line into the totals.

If there a way to have the report layout print on 1 page and if it doesn't fit it goes to the next page or allow it to break across pages?

The length of the report layout is not always the same so the Need Lines function on "Maintain Report Layouts" is not foolproof.

Any info would be helpful.

Thanks.

Rena

mark_h
27th January 2006, 05:35
What kind of layouts are you using? Do you have "page" checked on the layout? This would cause a layout to be repeated if it went across page breaks. More information is needed. You can always track the total yourself in the report script.

mr_suleyman
27th January 2006, 08:39
IF you use TOTAL() function on report layout , you should try to calculate your total in report script. it should work for your case ! sometimes as you said total functions can give wrong results because of layout structures and working. It is best way is to use programming.

Good Luck !

en@frrom
27th January 2006, 12:20
You must either have the field 'page' ticked on - like Mark suggested - or maybe it is a before.field layout type, in this case you should write a condition in the 'output expression': lattr.break

Explanation:
layouts of type before.field, are printed when the sort field value changes AND when there is a page break (even when the field value has not been changed).

lattr.break is a predefined variable which contains true when the layout is printed due to sort field change, and to false when due to page breaks. So by setting the output expression to lattr.break (i.e. lattr.break = true) you cause the layout to be printed only in case of the field value changing

renam9
27th January 2006, 23:38
Thanks for the ideas.

The lattr.break = true worked.