Map spooled file data from current page

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 number of output pages.

 

You can map the spooled file contents, after you have loaded a sample spooled file in the designer.

 

If you want to only map pages within the pagerange of the input spooled file, then you should check out the section, Use the page range of an input spooled file.

 

It is explained below, but you can also see an example in this video:


Before you start mapping data, it is highly recommended to change the template, so that one output page will be added for each input page. To do that you should do as below:

 

1.Insert a Repeat element in the top of the template

 

NG2MapSplfs0007

2.On the Repeat element select For each page in the spooled file on the bottom left:

 

NG2MapSplfs0008

- and click Apply.

 

3.Now rearrange (drag) the Repeat and/or page element, so that the page element is placed inside the repeat like below:

 

NG2MapSplfs0009

With the change above the output from InterFormNG2 will be exactly as many pages as there are in the input spooled file.

 

4.The final step is to map data from the current spooled file page. You do that with the text element inside the page, and here you need to click Expression in the top:

 

NG2MapSplfs0003

 

Now you click the magnifying glass on the right to see the contents of the loaded sample spooled file:

 

NG2MapSplfs0010

 

You map spooled file data, by dragging a blue frame over the positions and lines, that you want to map. Keep the default value of Auto as the Page selection on the top left.

 

5. When you click OK the page mapping is inserted. The resulting function depends on the spooled file format used.

 

If the spooled file format is version 1.0 (legacy), then the function looks like this:

ng:spoolMap(./text(), 2, 27, 6, 11)

 

NG2MapSplfs0011

 

(This maps position 2 to 27 from line 6 to 11)

 

The built-in function is described here.

 

If the spooled file format is version 2.0, then the function looks like this:

ng:spoolMap(., 8, 34, 6, 12)

 

NG2MapSplfs0015

 

(This maps the positions 8 to 34 from line 6 to line 12)

    • Related Articles

    • Map spooled file data from a specific page

      Map spooled file data from a specific page You can map the spooled file contents, after you have loaded a sample spooled file in the designer. If you want to iterate across all pages in the spooled file to have an output, that is as many pages as the ...
    • Change page breaks of a spooled file

      When you merge an input spooled file with a template in InterFormNG2 e.g. for PDF or print output, then you normally want the same page breaks in the output as in the original input spooled file. You are however not necessarily limited by that and ...
    • Map spooled files in the designer

      You can map spooled file data in the designer, after you have loaded a spooled file. Mapping is done with the either ng:spoolMap or the ng:spoolMapRel built-in functions. This section covers this: •How to view the spooled file contents •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 ...
    • 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 ...