- Describe the Header of the table. As decided in Step 13, the names of the Reference and the Designation columns are described by keywords (Table element → Properties dialog box → Columns tab → column Properties dialog box), while the names of the Quantity, Unit Price, and Total columns are detected using the previously described auxiliary elements.
- Describe the Footer of the table. As decided in Step 13, the footer is detected using the previously described element that uses keywords and phrases to find the beginning of the footer.
- Describe the search area of the table. Use the Sales column name to restrict the search area on the right.
Create the InvoiceTable element
To create the InvoiceTable element:- Create an element of type Table and name it InvoiceTable.
- Click the Columns tab.
- Click Select and specify the previously described InvoiceTable block as the block to be detected by the InvoiceTable element. For detailed instructions, see Step 3.
- Select the Reference column and click Properties…. The keyword Reference will be used to look for this column name, so leave the default values.
- Select the Designation column and click Properties…. The keyword Designation will be used to look for this column name, so leave the default values.
- Select the Quantity column and click Properties…. Use the previously detected element
TableHeader.kwQuantityto find this column name. Select the Use found element as column name option and click
to select the TableHeader.kwQuantityelement.

- Select the UnitPrice column and click Properties…. Use the previously detected element
TableHeader.kwUnitPriceto find this column name. Select the Use found element as column name option and click
to select the TableHeader.kwUnitPriceelement.

- Select the Total column and click Properties…. Use the previously detected element
TableHeader.kwTotalto find this column name. Select the Use found element as column name option and click
to select the TableHeader.kwTotalelement. - Click the Order tab.
- There can be other columns between the sought ones (for instance, Unit), but the sought columns are always located in the following order: Reference, Designation, Quantity, Unit Price, Total. Select the Rules for column order option, and then click Add… and specify the following column order:
Reference << Designation << Quantity << Unit Price << Total.


- Click the Header tab. The header is needed, but no search constraints are added, so leave the default values.

- Click the Footer tab. Use the previously detected element
Footer.kwFooterto detect the footer. Select the Use found element as footer option and click
to select the Footer.kwFooterelement.

- Click the Rows tab.
-
Since some columns in the table can have entries consisting of multiple lines, you have to specify a master column to detect the rows. Select the Use master columns to detect rows option.
Specify the Total column as the primary master column, as this column always contains data and a single row of the table corresponds to each entry. In case this column is not detected on a document, specify the Quantity and Unit Price columns as secondary and tertiary master columns respectively. Click
and specify this order of master columns.

-
Click the Relations tab. Since the sought columns are located to the left of the beginning of the name of the Sales column (with a small gap), set the following search constraint:
- Left of the element
TableHeader.kwSales, - Offset = -40, Reference boundary = Left.
- Left of the element
- Match the FlexiLayout with the test images. You see that the program has successfully detected the table element on all the images where it occurs. But on some of the images, the Quantity column also includes unwanted artifacts from the previous column. To separate the useful data from noise, specify the type of content that can occur in the column.
- Open the Properties dialog box of the InvoiceTable element. Click the Columns tab, open the Properties dialog box for the Quantity column and select the Check content type option. Select Number in the Type of column content drop-down list.

- Try matching the FlexiLayout with the test images and make sure that the Quantity column does not contain any unwanted data.
- To describe the location of the InvoiceTable block, select the Source element option, and then click
and specify the InvoiceTable element as the source element.
