Layouts tab

Use this tab to display the layouts of a report. Through the layout shortcut menu commands, you can perform these actions:

  • Add or remove layouts.
  • Edit the selected layout.
  • Edit all layouts simultaneously.
  • Copy a layout from another report.
  • View the selected layout.

For more information on the Layout commands, see Layout shortcut menu.

The tab displays a list of all layouts, by their name, used by the report.

Here, you can remove, add/edit layouts, and copy a layout from another report. If you add a layout type that already exists, ensure the sequence number of the new layout is different from sequence number of the existing layouts.

For more information about previous layout operations, see Add and remove layouts.

The Layouts list displays the following layout attributes:

  • Layout Type

  • Field Name

  • No

  • Output Expression

Add and remove layouts

To add a layout:

  1. Click Add. Alternatively, press Alt+A or right-click in the Layouts list and select Add.
  2. Specify the properties of the new layout. See the field help.

  3. When you finished adding layouts, refresh the Layouts list, so the new layouts are displayed at the appropriate positions. Right-click in the Layouts list and, on the shortcut menu, select Refresh.

To remove a layout:

  1. Right-click a layout and select Remove. Alternatively, select a layout and press Alt+DEL.
  2. Right-click in the Layouts list and select Refresh.
Layouts
Layout Type
The layout type.
Note: You can select a layout type from the list. When you select a layout type that is already used, specify a sequence number different from the numbers of the used layouts.
Allowed values:

A report can contain the following layout types:

Before.report Layouts of this type are printed once at the beginning of the report. Use this layout to present information about the report. For example, the title page of the report.
Header Header layouts are printed at the top of every page.
Before.field You can define this layout for each input field for which a sort mode is defined. Each time the value of the sorted input field changes, this layout is printed before the Detail lines. In this way the records are grouped.

If a group of records spans more than one page, the Before.field layout is repeated at the top of the new page (following the header).

To suppress automatic printing at the top of every page, use lattr.break as an output expression. lattr.break is a predefined variable that contains the value 1 (true) when the sort field changes. When you use this output expression, the layout is only printed when the input variable is changed.

To define multiple grouping levels in a report:

  1. On the Input Fields tab, define a Sort Mode and a Sort Seq. for each input field by which the records must be grouped.
  2. Define a Before.field for each of these sort fields.

An example of multiple grouping levels is to group Purchase Order records first by buyer, and then by buy-from business partner.

The order of sorting and grouping depends on the sort sequence that was specified. This is the sequence of the fields in the Input Fields list.

Detail Detail layouts are used for the individual records included in the body of the report. They are printed every time data is sent to the report.
After.field You can define this layout for each input field for which a Sort Mode is defined in the Input Fields tab. Each time the value of the sorted input field changes, the layout is printed after the detail lines. In this layout, the presorted input field still contains the old value.

Among other things, this layout can be used to print totals for a particular group of detail lines.

Footer Footer layouts are printed at the bottom of each page.

This layout is used to print this information:

  • Titles
  • Page numbers
  • Page totals
After.report This layout is only printed at the end of the report, and after all other layouts. If this layout does not fill a complete page, the footer layout is printed at the bottom of the page, where the After.report layout(s) is printed.
Note: The Field Name field is applicable only if you select Before.field or After.field layouts.
Field Name
The name of an input field used to activate Before.field and After.field layouts. When the field value changes, the layout is printed.
Note: Select a field from the list.
Allowed values:

You can only specify fields, which are defined as a sorted input field in the Input Fields tab of the report editor.

The Field Name attribute only applies to Before.field and After.field layouts.

No.
The sequence number of the layout.

You can define more than one layout per Layout/Fieldname combination. The layouts of the same Layout/Fieldname are printed in the order of the sequence number of the layouts.

There are two reasons to define more than 1 layout per Layout/Fieldname combination:

  • The maximum size of a layout is 22 lines. If your layout needs more lines, make a second layout of the same type with a higher sequence number.
  • If a particular layout must be printed under certain conditions and another layout under other conditions, define more than one layout with different output conditions.
  • If the report already uses the previously specified layout type with the same sequence number, LN Studio issues the following warning:

    Record not unique.

Note: You can only add a layout type that already exists in the current report if the sequence number of the new layout differs from that of the existing layouts.
Output Expression
An expression which is evaluated at runtime. The result is always true or false. The expression syntax is equal to the 3GL syntax. When a layout must be printed, the system evaluates the output condition of the layout. If the result is true, the layout is printed.
Example:
Output Expression Print result
1 Layout is always printed.
0 Layout is never printed.
print.detail = 1 or print.detail = 2 Layout is printed if variable print.detail is 1 or 2.
strip$(tdsls041.cprj) <> "" Layout is printed if field tdsls041.cprj is not empty.
Allowed values:

The variables used in the output expression must be defined as input fields for the report.

Allowed values:

The default value is 1. Therefore, the expression is always true and LN will print the layout (if not prevented by other controls).

Format
Different Font
The font in which the layout is printed.
Note: This field only applies to a report that can have different fonts. You can only specify another font if you previously selected Fixed Device Font on the Overview tab of the Report Editor.
Allowed values:

These fonts can be defined in the printer information files of the printer being used.

To specify a value for this field, select a font from the drop-down list.

For example, you can choose one of these fonts:

  • Large (10 cpi)
  • Small (17.1 cpi)
  • Middle (12 cpi)
  • Double Wide
  • Near Letter Quality
  • Italic
  • Superscript
Extra Need
This number indicates how many extra lines are required for the layout on the same page.

Before printing a layout, the report writer calculates the free space at the current page. If the layout does not fit on the same page, the layout is printed on a new page. If the value of this field is 0, only the number of lines of the layout itself is taken into account. With this field you can increase the number of extra free lines for the layout. This can be useful if you want to print at least 2 detail layouts on the same page together with a Before.field layout.

Note: This field does not apply to the Header and the Footer layout types.
Allowed values:

A whole number in the range 1-99.

Multi columns
This field indicates whether the report layout must be printed in more than one column or not.

The number of columns depends on the size of the layout and the paper width. Change the layout size with the command <Esc>[S] in the report layout editor.

Allowed values:
Select one of the following values from the drop-down list:
  • None
  • Vertical Order
  • Horizontal Order
New Page
If this check box is selected, the report layout is printed on a new page. Skipping to a new page always causes printing of present Header, Footer and Before.field layout types. If the current line is at the top of the page, the page command is ignored.
Note: This field does not apply to Header and Footer layouts.
Number of Columns
The number of characters or positions per line.
Allowed values:

This display field is read-only. This number is calculated automatically.

Number of Rows
The number of lines of the report layout.
Allowed values:

This display field is read-only. This number is calculated automatically.

Layout shortcut menu

Add (Alt+A)
Adds a new layout record to the Layouts grid.
See Add and remove layouts.
Remove (Alt+DEL)
Removes the selected layout record from the Layouts grid.
See Add and remove layouts.
Refresh
Refreshes the list of layouts. Use this command after you added or removed a layout.
Copy
Copies the selected layouts. You can paste the copies in the list of layouts in the current report, or in another report.
Paste
Pastes copies of report layouts in the list of layouts.
Edit Layout
Opens the selected layout in an ASCII oriented report layout editor (ottadvformedit) of LN. See the online Help of LN.
Edit All Layouts (Alt+Y)
Opens all layouts in an ASCII oriented report layout editor (ottadvformedit) of LN. See the online Help of LN.
Copy from Other Layout
Copies a layout from another report available in the development repository of the current LN server.

The command starts the Copy from other layouts dialog. In this dialog, choose a report and select one of the layouts of this report.

This is helpful if you repeatedly use the same elaborate layouts, such as with complex expressions or formats.