Table of contents

 




Official Content

If you need to generate a visual output in a Procedure object, you have to access to the Procedure Layout section in order to define the data to be listed and the output format.

DefaultLayoutWithOnePrintblock

By default, the Layout section contains a first printblock (named: printBlock1), which is empty and ready to be used. Inside it, you can include whatever you want to show.

Suppose you have to define a procedure in order to list all the airlines a Travel Agency works with.

Since the procedure Layout is composed by one or several printblocks (that do not necessarily have to respond to the same order as required for the output), each printblock must have one single name to be referenced from the Procedure Source (by using the Print command).

In the example, the first printblock will contain a logo, a title, the current day and hour, the page number, labels with titles and a line. So, insert those controls inside the printblock and rename it as "Pb_Header" (by modifying the printblock Name property).

Layout Pb_Header

Observe the elements that were added to the "Pb_Header" printblock. Most of the actions were achieved through drag&drop from the available Toolbox for this section:

ToolboxProcedureLayout

and by setting the controls properties.

In particular to insert the logo, the Image icon has to be dragged from the Toolbox to the printblock and a dialog is opened offering you some possibilities, such as import the image from a file.

The system variables such as &Date, &Time and &Page, can be inserted by selecting: Insert > Variable... from the Menubar or by dragging and dropping the Attribute/Variable control from the Toolbox.

Inserting Printblocks

Inserting printblocks is very simple. To do so, you have to right-click on a specific printblock and select from the context menu the Insert Printblock option. This action will insert a new printblock below it.

InsertPrintblock

Look at the following figure. The second printblock has been inserted in the Layout section and the AirlineId and AirlineName attributes have been added to it.

Layout Pb_Body

To change a printblock's position, the context menu offers the Move Up and Move Down options.

Aligning and Resizing Controls

To align several controls at once (or to make them the same size), select them by holding down the Ctrl (or Shift) key and clicking on the desired controls. The last one (which will have its selection nodes highlighted in bold) will be the reference control for the action. Then, you only have to right-click and select from the context menu the option you are needing.

AligningControlsInPrintblocks

Inserting a variable based on an SDT

You can also insert in any printblock a variable that is based on a Structured Data Type. The options to insert it in the printblock are the same as for any variable. A dialog will be opened so that you can select which members you want to include in the printblock. One control for each member will be inserted and their FieldSpecifier property (which is mandatory) is for setting the collection position to be shown.

Invoking the Printblocks

Remember the procedure logic is written in the Procedure Source and from there, the Printblocks defined in the Procedure Layout must be invoked using the Print command:

ProcedureSourceThatPrints

Note that:

  • The For Each command is used as in any procedure to navigate in this case the Airline table and one of the printblocks is referenced inside it in order to print the scanned data.
  • The other printblock is referenced inside the Header command in order to be printed at the top of each page.


Layout Properties

You may access another set of properties (such as paper height, width, orientation, and so on) by clicking on the arrow in the upper left-hand corner of the layout window:

Report Layout Properties


Note

In most cases, procedures with Layout are defined in order to print PDF outputs. Therefore, the following simple requirements must be set for the object.


See Also

Printing Commands Summary

Videos

Start Video Lists and For Each command to query the database

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant