fmchong
14th January 2011, 09:08
Dear Baan Experts,
How to fix the DETAIL Section to certain number of Line in report script?

PO 100001 (Page 1) - Before.field

10 Item A 2 pcs---> Detail
20 Item B 3 pcs
30 Item C 1 pcs

PO 100001 (Page 2)

40 Item D 4 pcs -----> Detail
50 Item E 10 pcs
60 Item F 1 pcs

Total 21 pcs


Please help

Thank you so much

sameer.don
14th January 2011, 10:18
I think few similar requirements have been discussed in last few months on Baanboard.

You can control the count of detail layout through report script.

You can declare a variable, say, count.detail

Increment the variable by 1 in detail.1
In after.layout of detail.1 you can use page() function which produces a page break, hence printing remaining content on next page.

so, your code may look like:

detail.1:
before.layout:
count.detail = count.detail +1

after.layout:
if count.detail > 5 then
count.detail = 1
page()
endif



This code will print the detail.1 layout uoto 5 times on one page. So if there are 20 records. Report will be printed with 4 pages

fmchong
18th January 2011, 07:47
Dear Baan Experts,
Thank you so much for the advise.Script below is work in 1 detail line.
if let say i have 3 details

PO 100001 (Page 1) - Before.field

10 Item A 2 pcs---> Detail 1
Discount 10% -----> Detail 2 (Discount > 0 then only appear)
20 Item B 3 pcs
Tax 20% -------> Detail 3 (Tax > 0 then only appear)
30 Item C 1 pcs

PO 100001 (Page 2)

40 Item D 4 pcs -----> Detail 1
50 Item E 10 pcs
60 Item F 1 pcs
Discount 20% -----> Detail 2 (Discount > 0 then only appear)


Total 21 pcs

Total Lines only can print in page are 5 lines.

Please advise.

Thank you very much