amator
15th August 2016, 11:04
Hi guys,

I want to ask how to declare not to print the before.field layout in detail layout if the detail layout is empty.

For example:

before.field.1
before.layout:

after.layout:

detail.1
before.layout:

"CODE HERE HOW TO DECLARE NOT TO PRINT THE BEFORE FIELD LAYOUT IF MY CODE HERE IN DETAIL LAYOUT DOESNT GET ANY DATA OR EMPTY"

after.layout:


I'm new in baan.

Thanks in advance,
Amator

bdittmar
15th August 2016, 14:03
Hi guys,

I want to ask how to declare not to print the before.field layout in detail layout if the detail layout is empty.

For example:

before.field.1
before.layout:

after.layout:

detail.1
before.layout:

"CODE HERE HOW TO DECLARE NOT TO PRINT THE BEFORE FIELD LAYOUT IF MY CODE HERE IN DETAIL LAYOUT DOESNT GET ANY DATA OR EMPTY"


after.layout:


I'm new in baan.

Thanks in advance,
Amator


if condition then
lattr.print = false
else
lattr.print = true
endif

oirfeodent
16th August 2016, 07:38
guess before.field.1: cannot be controlled from detail.1:
But try lattr.enddata, if nothing to print in detail.1: this field should have the info.

before.field.1
before.layout:
if lattr.enddata then |Check if anything to print.
lattr.print = false
endif

amator
16th August 2016, 08:25
Hi bdittmar,

Thanks for the reply. I tried to insert my query and codes in the before field layout instead of detail layout and I tested it if there is an error. Yes it works I can insert the code and query in before field and it works the same when it is in the detail so I tried your advice the lattr.print and a condition. Yes again it works but i have another problem in the out put.

For example (Based on the original output)

Page 1 output:

FFFFFFFFFFFF
______________
PREPARED BY
--------------------------------------------------------------------------------------------------------
Page 2 output:
Report Title
LABEL: FFFFFFFF PAGE NO.: 2
LABEL: FFFFFFFF DATE: FFFFFFFFFF

DATE ITEM DESCRIPTION AMOUNT
FFFFFFF FFFFFFFF FFFFFFFFFFFFF FFFFFFFFFFFFFFFF



FFFFFFFFFFFF
______________
PREPARED BY

---------------------------------------------------------------------------------------------------
Page 3 output:
Report Title
LABEL: FFFFFFFF PAGE NO.: 3
LABEL: FFFFFFFF DATE: FFFFFFFFFF

DATE ITEM DESCRIPTION AMOUNT
FFFFFFF FFFFFFFF FFFFFFFFFFFFF FFFFFFFFFFFFFFFF

--------------------------------------------------------------------------------------------------------

Notice that the first page is the footer only and the last page is w/o footer.
The first page should be no data the second page should be the first data.

Thanks in advance,
Amator

mark_h
16th August 2016, 14:25
What I think is happening is the detail layouts are being skipped because of your test, but at footer time it probably has the data for the next page. Your best bet is to debug the report step thru it and see what data you have at the footer - then make sure you have a check for it. My guess is the footer has the new data and your test might not be working like you think. So debug it and get to the footer section and make sure the test in it is actually working.

amator
19th August 2016, 04:56
What I think is happening is the detail layouts are being skipped because of your test, but at footer time it probably has the data for the next page. Your best bet is to debug the report step thru it and see what data you have at the footer - then make sure you have a check for it. My guess is the footer has the new data and your test might not be working like you think. So debug it and get to the footer section and make sure the test in it is actually working.

Hi Mark,

Thank you for the comment.I debug it and I found some detail in the first page. I reconstruct my conditions in the detail layout. and now it works.

Thank you,