Please enable JavaScript to view this site.

InterFormNG2 Manual

In this section I will show you how you can make InterFormNG2 iterate across detail lines in an input spooled file, and how to setup conditions on each detail line.

 

This can be done in two different ways depending on which spooled file format, that is used. The recommended and most simple way is to use the version 2.0 of the spooled file format.

 

The related section: Handling multi-line conditioned sections is recommended.

 

Solution for version 2.0 (recommended)

 

An example is explained in steps below, but you can also refer to this video for help:

 

 

For this example we want to scan all the detail lines of a spooled file. The detail lines are in the range from line 30 to 42 and they look like below (starting with the line InterWord400):

 

NG2ItAcrossDetailSplfLines0001

 

We want to scan all detail lines of all pages in the spooled file. For each detail line we want to print out the Product and verify if the Product starts with the text 'Inter', If so, then we want to insert an extra text 'InterForm!' next to it.

 

 

First you need to create a new template and load the spooled file in the designer.

 

Now you need insert a repeat element and select the option For each spool page on the left, bottom part of the properties as shown here.

 

Now you need to rearrange the repeat element and the page element, so that the page element is placed inside the repeat element:

 

NG2ItAcrossDetailSplfLines0002

For each page we want to scan line 30 to 42, so we insert an extra repeat within the page element and in the repeat element we can select the lines to scan with the mouse and then click OK to save the change. (Please notice, that you can only select the lines - not specific positions)

 

NG2ItAcrossDetailSplfLines0012

 

Now the template tree looks like this:

 

NG2ItAcrossDetailSplfLines0013

(The last repeat element specifies, that we are doing a repeat on the current page and we start at line 30 and repeats through the next 13 lines).

 

Inside the repeat we insert a container to hold the columns of each detail line. We set a fixed height as the texts insider a going to have fixed positions (in this way each element can be placed independently of each other):

 

NG2ItAcrossDetailSplfLines0014

 

We have chosen these fixed dimensions of the container:

 

NG2ItAcrossDetailSplfLines0006

 

Inside of this we can now place a text element to print out the first column (in a fixed position):

 

NG2ItAcrossDetailSplfLines0015

(Please notice, that the spooled file area handled by the last repeat is marked in dark grey, when we extract spooled file data in the text element).

 

When we click OK to add the new text element (in a fixed position), then the element tree looks like this:

 

NG2ItAcrossDetailSplfLines0016

 

The text element use the standard XPath function, substring to extract the spooled file data from position 8 and the next 16 characters of the current spooled file line within the repeat loop.

 

Next we want to use a condition to verify, if the first 5 character of the product is 'Inter'. We do that with the if element or a select element. You can consider to activate relative mode and setup an anchor line, and use the function, ng:spoolMapRel if you want to handle conditioned sections of a spooled file.

 

NG2ItAcrossDetailSplfLines0017

(We also select the characters of the current line like we did for the text element above).

 

Inside the condition we now finally insert the conditioned text:

 

NG2ItAcrossDetailSplfLines0018

 

The final result looks like this:

 

NG2ItAcrossDetailSplfLines0019