tion1976
25th January 2023, 12:10
Using Infor LN report tool I have a confusion on the order of the layouts. My After.field layout on field tiitt110.cmtg come first after Detail layout even if the input fields order is different. tiit110.cmtg has Ascending sort order and sort seq 4. See my attached screenshots.
Can one explain what is the reason for layout order appearing different?
Thanks

RobertP
25th January 2023, 12:31
It's possible to have several layouts for one input field. See screenshots.

The order here is not per sequence of input fields. Instead, by report structure --> Before.report, header, before.fields, detail, after.fields, footer, after.report.

It can become confusing because the actual report output does not match exactly what one sees when developing. But we all work with it. Hope this helps. Cheers

bdittmar
25th January 2023, 13:14
Hello,

Report sections (report scripts)
A report consists of a number of layouts, which define the content and organization of the various parts of a report (for example, the header, footer, and body of the report). There are a number of possible layout types, as follows:

before.report – printed once at beginning of the report (a title page, for example)
after.report – printed once at the end of the report
header – printed at the top of each page
footer – printed at the bottom of each page
before.field – printed before each group of records in reports of type 3; if a group of records spans more than one page, the before.field layout is repeated at the top of the new page
after.field – printed immediately after each group of records in reports of type 3
detail – used for the individual records included in the body of the report
The content and arrangement of these layouts are defined in the data dictionary.

In the report sections in a report script, you can program actions to be performed before and/or after execution of individual layouts of these types. Report sections consist of a main section and a subsection. You use a main section to specify the particular layout for which the programmed actions are to be executed. You must follow a main section with either a before.layout or an after.layout subsection. These latter specify whether the actions are to be executed before or after the particular layout is printed.

Main sections
before.report.<layout_number>:
Actions programmed in this section are executed for a specified layout of type before.report.

after.report.<layout_number>:
Actions programmed in this section are executed for a specified layout of type after.report.

header.<layout_number>:
Actions programmed in this section are executed for a specified layout of type header.

detail.<layout_number>:
Actions programmed in this section are executed for a specified layout of type detail.

before.<field name>.<layout_number>:
Actions programmed in this section are executed for a specified layout of type before.field.

after.<field name>.<layout_number>:
Actions programmed in this section are executed for a specified layout of type after.field.

footer.<layout_number>:
Actions programmed in this section are executed for a specified layout of type footer.

Subsections
before.layout:
Actions programmed in this subsection are executed before the specified layout is printed.

When lattr.print is set to false, the layout is not printed and the before.layout and after.layout sections are not executed. If you set lattr.print to falsein the before.layout section itself, the layout is not printed and the after.layout section is not executed.

after.layout:
Actions programmed in this subsection are executed after the specified layout is printed.

Regards

OmeLuuk
25th January 2023, 17:36
Can one explain what is the reason for layout order appearing different?For instance InforLN 10.7 report tdpur443101300 has several before and after field sections. When in session ttadv3531m000, select one line and press Ctrl-Shift-8 and check the query used:SELECT ttadv331.*,ttaad110.dsca,ttadv100.dsca
FROM ttadv331,ttaad110,ttadv100
WHERE ttadv331._index1 = { :ttadv331.clan, :ttadv331.cpac, :ttadv331.vers, :ttadv331.rele, :ttadv331.cust, :ttadv331.cmod, :ttadv331.crep} AND
ttadv331.clan REFERS TO ttaad110 AND
ttadv331.cpac REFERS TO ttadv100
|Based on index:1
ORDER BY ttadv331.clan,ttadv331.cpac,ttadv331.vers,ttadv331.rele,ttadv331.cust,ttadv331.cmod,ttadv331.crep,ttadv331.layt,ttadv331.fldn,ttadv331.rseqwhere the sort order is Language - Package - Version - Release - Customer - Module - Report code - Layout Type - FIELDNAME - Sequence. So the layouts are shown by name not by sort order.

BTW there is a good reason for this. Checking the query of the sort order you will note:SELECT ttadv332.*
FROM ttadv332
WHERE ttadv332._index2 = { :ttadv332.cpac, :ttadv332.vers, :ttadv332.rele, :ttadv332.cust, :ttadv332.cmod, :ttadv332.crep}
|Based on index:2
ORDER BY ttadv332.cpac,ttadv332.vers,ttadv332.rele,ttadv332.cust,ttadv332.cmod,ttadv332.crep,ttadv332.srto,ttadv332.fldnso to sort the data in session ttadv3531m000 would require a sort on foreign key ttadv332.srto (other table, not necessary an index field) which can be done by the undocumented feature (!) query.extend.order(). I found out this might work but is most likely not stable, specially not in LN UI (related to the topic "Improved Record selection Cookbook" in the programmers manual).

I had to fix the TIV to 975 in one particular session to keep my customers satisfied... The documented way to do this is using query.define.sort.order() instead but the other field needs to be in an index.