Switch between different page layouts within a spooled file

Switch between different page layouts within a spooled file

Within a spooled file you may have so different formats of the pages, so that you would prefer to switch between different templates or just different layouts/designs through a spooled file.

(This is the function labeled as overlay selector in InterForm400).

 

You can get a long way with conditions both the if element and the select element in the designer and you can even use translation files to build a multi-language template (where you insert translation texts instead of fixed texts in a specific language) and in that way eliminate the use of switching between different templates/layouts/designs.

 

If you however do require to switch between different formats, then you can do it like indicated below:

 

 

NG2SwitchBetweenPageFormats

 

In order to set this up you first need to load a sample spooled file in the designer, so that the designer knows, that the input is a spooled file.

 

Then you can insert the repeat element and here refer to the page element like described in the section, Map spooled file from current page.

 

In the conditions above you can refer to the spooled file contents by simply clicking on the magnifying glass icon:

 

NG2SwitchBetweenPageFormats0002

 

and then (with the mouse) drag around the spooled file data, that you want to compare with to place the blue box marker:

 

NG2SwitchBetweenPageFormats0003

 

Please notice, that the page selection on the top left is 'Auto', which tells InterFormNG2, that you are comparing with data from the current page of the spooled file (referring to the page repeat).

 

In the example above I have used components to encapsulate the elements for a specific design - which makes it e.g. possible to reuse the component in another template or another place in the same template, but you do not need to define components.

 

 

In the example above all the components share the same page element, so with the setup above all pages will have the same size and rotation, but if you even want the page size or rotation to depend on the current page, then you can implement your template like below:

 

 

NG2SwitchBetweenPageFormats0004

 

Here each Page element has its own settings. In the example above the text in line 6, position 8 to 9 indicates which page size to use. You can even make it more advanced/dynamic as the page size can be set via an Xpath expression.

    • Related Articles

    • Spooled file support

      InterFormNG2 is able to process spooled files, if you install InterFormNG2 on the IBM i platform. Please notice, that spooled file support, as well as Spool2XML, are modules for InterFormNG2, that are purchased separately. You can also use the ...
    • Map spooled file data from current page

      Map spooled file data from current page This section covers the normal way of mapping spooled file data. This section explains e.g. what to do, if you want InterFormNG2 to iterate across all pages in the input spooled file and generate the same ...
    • Use the page range of an input spooled file

      This section covers solutions of how you can use the page range of an input spooled file in order to only process a sub section of a spooled file specified on the PAGERANGE parameter as a from and to page number. These scenarios are covered below: 1) ...
    • View spooled file contents

      This section shows how to view the spooled file contents in the designer. View the spooled file contents You can view the loaded spooled file, if you click this icon on the top left of the designer: Now you can see the contents of the spooled file on ...
    • Spooled file extract functions

      This section lists and describes the functions available to extract information from the spooled file. Normally you do not need to think much about this as the functions are normally added when you select an area in the input spooled file, so you do ...