ng:spoolMap

ng:spoolMap

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 easiest way to use the ng:spoolMap function is to first load a spooled file, and then insert the function via the magnifying glass e.g. in the text element.

 

Here is an example of the function:

 

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

(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).

 

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.

 

 

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.

    • Related Articles

    • ng:spoolMapCond

      IMPORTANT: This function is only supported for spooled files loaded in the old format, Version 1, which is not recommended - it is not supported for spooled files loaded in version 2, which is better, default alternative to load spooled files in. ...
    • ng:spoolMapRel

      The built-in function, ng:spoolMapRel is only available in InterFormNG2, if you are running InterFormNG2 on the IBM i platform, or have activated the AS400 option in InterFormNG2. This function only supports spooled files loaded in the version 2 ...
    • ng:resourceExist

      ng:resourceExist(resource,path) This function checks, if a resource in InterFormNG2 exists or not. The function returns a boolean: true or false. The ng:resourceExist Xpath function has this format: ng:resourceExist(resource,path), where: resource ...
    • ng:decrypt

      The built-in function, ng:decrypt is linked with the encryption functions: ng:encrypt and the workflow component, Set secure workflow variable. The function, ng:decrypt can decrypt contents, that was previously encrypted with these functions. The ...
    • ng:minimum

      InterFormNG2 includes the special built-in XPath function, ng:minimum. This function returns the smallest value of two numeric arguments. The function only accepts two numeric arguments - no more and no less. Examples: ng:minimum(-14,2) returns 2 ...