Rules to recognize line items

Datacap includes actions that simplify the processing of an undefined number of line items.

Table 1. Actions that simplify line item processing
Library Action Description
Zones ScanDetails Searches a line item grid object and looks for line items. Assign this action to the grid region in the document hierarchy.
Zones ScanLineItem Searches a line item object and looks for fields. Assign this action to each line item in the document hierarchy.
Zones PopulateZNLineItemField Populates the page data file with the recognized value in the zone for the current line item child field. Assign this action to each line item child field in the document hierarchy.
These three actions automate the process of reading line item grids. When you are assigning rules, the key is to make sure that the actions operate at the correct level in the document hierarchy.

Datacap runs each rule, first on the grid and then on each line item and field in the grid. As Datacap runs, it builds a data structure in memory. The data gets written to the page data file upon completion of the current task.

Table 2. Resulting data structures for selected actions
ScanDetails() ScanLineItem() PopulateZNLineItemField()
Runs once only (at the grid level) Runs once for each line item Runs once for each field
Resulting data structure (in memory):
Grid_region
  • Line_item0
  • Line_item1
Resulting data structure (in memory):
Grid_region
  • Line_item0
    • Item
    • Description
    • Cost
  • Line_item1
    • Item
    • Description
    • Cost
Resulting data structure (in memory):
Grid_region
  • Line_item0
    • Item = 1176
    • Description = Widget
    • Cost = $6.95
  • Line_item1
    • Item = 9122
    • Description = Widget
    • Cost = $8.25
In this way the three actions can read all the items in a grid of arbitrary length.