candle1113
15th January 2002, 03:05
I need help with explaining report script sections. I need to know if there is a good explanation or demonstration of what the difference between placing a field in the following type of report sections: (I've read the help that comes with BaaN and it doesn't give me a good explanation).
before.fieldname.#:
before.layout:
vs.
after.fieldname.#:
after.layout:
vs.
before.fieldname.#:
after.layout:
vs.
after.fieldname.#:
before.layout:
I hope someone out there can explain these sections to me.
Also how does the report sort order effect these sections?
~Vamsi
15th January 2002, 07:39
Baan generates a program which does the actual report printing. There are events that the programmer is allowed to program. These trigger at different times.
The "before.layout" is triggered before the standard program's code gets executed and the "after.layout" is triggered after the standard program's code.
The before.fieldname.# and after.fieldname.# on the other hand represent the "group headings" and "group footings" based on the "fieldname". These fire whenever the group field changes value. The before.fieldname can also fire whenever the page changes unless suppressed with a lattr.break.
The best way for you to discover how these things work is to put a report in debug and trace it.
evesely
15th January 2002, 16:23
Perhaps an example might help elaborate on ~Vamsi's reply. Let's say we have the following data:
FldX FldY FldZ
A 3 Orange
A 4 Apple
A 4 Banana
B 1 Kiwi
B 1 Cherry
Our report has FldX and FldY as sorted (ascending) inputs with sort sequences of 5 & 10, respectively. Then, if these layouts exist, this is the order in which the before/after field and detail layouts will run:
[list=1]
before.FldX.x
before.FldY.x
detail.x
after.FldY.x
after.FldX.x
[/list=1]
Here x represents the layout number. Within each type of layout, these are executed in numerical order. Within each layout, the before.layout runs, then the layout is printed, then the after.layout runs. In "before.layout" this is a good place to set variable values before printing and to prevent the layout from printing by setting lattr.print to false.
With the data I listed, the before/after field and detail sections would go like this:
[list=1]
before.FldX layouts for FldX=A
before.FldY layouts for FldY=3
detail layouts for A/3/Orange
after.FldY layouts for FldY=3
before.FldY layouts for FldY=4
detail layouts for A/4/Apple
detail layouts for A/4/Banana
after.FldY layouts for FldY=4
after.FldX layouts for FldY=A
before.FldX layouts for FldX=B
before.FldY layouts for FldY=1
detail layouts for B/1/Kiwi
detail layouts for B/1/Cherry
after.FldY layouts for FldY=1
after.FldX layouts for FldY=B
[/list=1]
As ~Vamsi mentioned, page breaks cause the before.field layouts to print again at the top of the page. You could suppress this by putting the following code in your before.layout section of the layout in question:
if not lattr.break then
lattr.print = false
endif
dmcgrath
16th January 2002, 13:38
We have a copy of Knowledge Quest 4.0 which is a information Database for baan IV. The information it contains is not brilliant, but is generally better than the help text in baan. Occasionally it does surprise you with some really useful information especially on 4GL/3GL Language features.
evesely
16th January 2002, 16:03
Here is another valuable source of information if you are using Baan IV. In BW, click on Tools from the main menu. Then choose Help, Contents. Click on the Programmer's Information link. Then click on the Report Scripts link. You'll need to click on the "Relations" button to see helpful information.
There is similar information in Baan V, but you get to it in a different way.
dmcgrath
16th January 2002, 16:22
Also in Baan IV is Print User Documentation (ttadv7450m000) which if you use set of components 'manprint' gives you an output of the programmers manual which also details such things as 4GL/3GL language features, error codes and other useful information - unfortunately its over 500pages long!!!!