If the developer needs to generate a visual output in a Procedure object, he/she has to access to its Layout section in order to define the data to be listed and the output format.
By default, the Layout section contains a first printblock (named: printBlock1), which is empty and ready to be used. Inside it, the developer can include whatever he/she wants to show.
Let's suppose the developer has 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 our 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, let's insert those controls inside the printblock and let's rename it as "Pb_Header" (by modifying the printblock Name property).
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:
and by setting the controls properties.
In particular to insert the logo, the Image icon was dragged from the Toolbox to the printblock and a dialog was opened offering the developer 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, the developer has 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.
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.
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.
Inserting a variable based on an SDT#
You can also insert in any printblock a variable which 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:
- 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.
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:
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.