RobertB
27th April 2007, 14:57
Hi all,

I haven't had much to do with Baan programming/customization for a while, and have a problem for which there may be a simple solution.

We have a customized report whinp1400m000 "Planned Inventory Transactions by Item" which needs to be further customized. At the moment, the report has sections:

header
before.field whinp100.item
detail
after.field whinp100.item
after.report
So far, so good. Now I want to alter things such that, for certain items only, a second set of layouts:

before.field some.other.field
some.other.field detail
after.field some.other.field
are printed directly after the after.field whinp100.item, and before the before.field for the next item. This second set of layouts are based on a completely different table, and different sort-field, thant that used in the item field layouts.

In other words, I want something like this to appear in the final report:
# Here's a "normal" item...
[before.item]
[item detail]
[item detail]
[item detail]
[after.item]

# Here's another one...
[before.item]
[item detail]
[item detail]
[after.item]

#This item is a "special" one...
[before.item]
[item detail]
[item detail]
[item detail]
[item detail]
[item detail]
[after.item]

# ...and hence the need for a special set of layouts to be printed before the next item...
[before.some.other.field]
[some.other.field detail]
[some.other.field detail]
[some.other.field detail]
[after.some.other.field]

# "Normal" item...
[before.item]
[item detail]
[item detail]
[after.item]

# etc.........
I'm not sure whether this is simple or difficult or impossible to achieve. Any clues or printable comments :rolleyes: will be most welcome!

TIA,
Rob

mark_h
27th April 2007, 15:58
Are these fields input to the field or are they fields you will be retrieving in the report script?

(1) If input fields then just add them to the sort and do normal layouts. I don't think this is the case, but mention it anyway.
(2) If this is data you are going to look up. Then just add another item layout. In the before.layout you would do a check - and if it was false then you would set lattr.print to false skipping the second item layout. If it is true then you would run what code you needed, check for the end, and if not end then use layout.again.

So it would look like this in the script:

after.item.1:
before.layout:
...do some stuff...

after.item.2:
before.layout
If i.am.not.special then
lattr.print = false
endif

after.layout:
if i.am.not.done then
layout.again()
endif


Something like this.