Please enable JavaScript to view this site.

InterFormNG2 Manual

The built-in function, ng:spoolMap is only available in InterFormNG2, if you are running InterFormNG2 on the IBM i platform.

 

With this function you can map data from an input spooled file in the designer, and extract information from the spooled file e.g. to use a conditions in both the designer and the workflow.

 

An alternative to the ng:spoolMap is the ng:spoolMapCond function, that only maps spooled file lines, that fit a specific condition. You can also consider to use the ng:spoolMapRel for referring to spooled file lines x-lines below a valid condition.

 

 

The spoolMap command are normally inserted in either of these ways:

1.One way is use the ng:spoolMap function is to first load a spooled file, and then insert the function via the magnifying glass icon e.g. in the text element. This is covered below in the section below: Refer to spooled file contents in an existing element.

2.Another way is to drag spooled file contents into the result view.

 

Here is an example of the function:

 

ng:spoolMap(//page[1], 1, 132, 1, 80,'trim')

(This selects the spooled file data from page 1 of the input spooled file. It takes the information from position 1 to 132 of the lines from 1 to 80 and trims each line).

 

The parameters of the function, ng:spoolMap are in this sequence:

 

1.A reference to the page, that you want to map.

2.The start position number to map.

3.The end position number to map.

4.The start line to map.

5.The end line to map.

6.An optional trim option. If this parameter is trim, then each spooled file line is trimmed of any leading and trailing spaces. If this parameter is missing or has any other value than 'trim', then the spooled file data is not trimmed.

 

 

The first parameter is a bit special. For that you have two options:

 

1.You can refer to a specific page number. You should e.g. do that, if you e.g. to insert a condition to compare spooled file data in a specific page, positions and line. For that you select the page number like above: //page[<nbr>], where <nbr> is the page number, that you want to select.

2.You can also refer to the current page. This usage is normally only used in the designer, where you repeat the page element for all pages in the input spooled file as shown in these sections: Map spooled file data from current page and Reproduce input spooled file as output. In these examples you should map the spooled file data with Auto set as the page number in the upper right corner. If you want to type in a reference to the current number, then the page reference in the ng:spoolMap function should be ./text(), so the function: ng:spoolMap(./text(), 2, 27, 6, 11) maps position 2 to 27 of lines 6 to 11 of the current page.

 

 

Mapping only a single blank line

Special information concerning mapping of blank lines (including lines with just blanks): If this function is mapping only one single blank line, then this will not force a vertical reposition in a dynamic flow. This and the workaround/solution is covered in the section, Vertical flow for a blank text of the text element.

 

 

Refer to spooled file contents in an existing element

One way to refer to spooled file contents is e.g. in an existing text element. Here you first click Expression and then the magnifying glass to view the spooled file contents. Then you see the spooled contents as below:

 

NG2SpoolMap001

 

If this is the first time you enter this for the current parameter, then you see the trim option in the top. This is default enabled. That means, that if you now select an area with the mouse and then click OK and Apply, then the text from the spooled file is mapped, but each spooled file line is trimmed of any leading and trailing blank - if the trim option is enabled.

 

 

 

Drag spooled file contents into the result view

Another way to map spooled file data into the output (after the spooled file has been loaded in the designer) is to click this icon on the top left:

 

NG2SpoolMap002

 

Then you can with the mouse drag around an area (which will be marked with a box) and then drag that area to the result view while holding down the left <CTRL> key on the keyboard.

 

For this mapping the trim option is default enabled:

 

NG2SpoolMap003