Skip to main content
Now that all the preparations have been made, you can search for the Invoice Table field by creating a Table element:
  1. Header of the table. As decided earlier, specify column names using already detected auxiliary elements.
  2. Footer of the table. As decided earlier, the Footer is specified using the already detected required element Paragraph from the InvoiceFooter group, which identifies the beginning of the final part. This element was described as the closest to the bottom of the table.
  3. Search area for the table. You can limit the search area on the right using the name of the last Sales column, which is not needed for any other purposes.

Create the InvoiceTable element

To create an InvoiceTable element:
  1. In the SearchElements tree, create an element of type Table and name it InvoiceTable.
  2. Click the Columns tab.
  3. Click Select to select the InvoiceTable block created earlier in Step 3 as the block to search for.
  4. Specify the search parameters for the table columns:
    • In the list of columns, select Reference and click the Properties… button.
      For the name of this column, use the previously detected TableHeader.kwReference element. To use it, select Use found element as column name, and then click Browse button and select TableHeader.kwReference.
    • In the list of columns, select Designation and click the Properties… button.
      For the name of this column, use the previously detected TableHeader.kwDesignation element.
    • In the list of columns, select Unit and click the Properties… button.
      For the name of this column, use the previously detected TableHeader.kwUnit element.
    • In the list of columns, select Quantity and click the Properties… button.
      For the name of this column, use the previously detected TableHeader.kwQuantity element.
    • In the list of columns, select UnitPrice and click the Properties… button.
      For the name of this column, use the previously detected TableHeader.kwUnitPrice element.
    • In the list of columns, select Total and click the Properties… button.
      For the name of this column, use the previously detected TableHeader.kwTotal element.
  5. Click the Order tab.
  6. Since the columns being searched for may be separated from one another by other columns (for example, ExtraQtyTag), but their order is always fixed (first Designation, next Unit Price, next Total), select Rules for column order, click Add…, and add the columns in the following order: Designation << Unit Price << Total.
Screenshot of the Order tab of the InvoiceTable Table element properties in ABBYY FlexiLayout Studio, showing Rules for column order selected with the Designation, Unit Price, and Total columns added in the required order.
  1. Click the Header tab. The Header of the table is needed, but no additional constraints are imposed, so keep the default values.
  2. Click the Footer tab. Use the previously detected element InvoiceFooter.Paragraph for the final part of the table. Select the Use found element as footer option, click Browse button and then select the InvoiceFooter.Paragraph element.
Screenshot of the Footer tab of the InvoiceTable Table element properties in ABBYY FlexiLayout Studio, showing the Use found element as footer option selected with the InvoiceFooter.Paragraph element chosen as the table footer.
  1. Click the Rows tab.
  2. Since the cells in some of the columns may contain multiple lines, you need to specify master columns for line separation. Select Use master columns to detect rows. First specify the Total column, as this column always contains data and for each table record this column has one line of data. If this column is not detected on the image, specify the Unit Price and Quantity columns as the next line separation option. Use the Browse button button to select these columns.
Screenshot of the Rows tab of the InvoiceTable Table element properties in ABBYY FlexiLayout Studio, showing Use master columns to detect rows selected with the Total, Unit Price, and Quantity columns specified as master columns for row separation.
  1. Select the Relations tab. Since the table columns of interest are located to the left of the name of the Sales column, add the following search constraints:
    • Left of the TableHeader.kwSales element, Offset = 0
    For poor quality images (for example, there is noise between the body and footer of the table, or there is no header or footer) you may specify upper and lower table limits. In this case, you can use the kwDesignation element as an upper limit and the Paragraph element as the lower limit. On the Relations tab, add the following search constraints:
    • Below the upper boundary of the kwDesignation element, Offset = -50, Reference boundary = Top
    • Above the Paragraph element, Offset = -50, Reference boundary = Bottom
  2. Match the FlexiLayout with the test images.
    You will notice that the program correctly detects the table element on all the images, but on some of the images the Quantity column includes redundant text from the preceding column.
    To separate the good data in the Quantity column from irrelevant data, specify the type of content for this column.
  3. Open the Properties dialog box of the table element InvoiceTable.
    Click the Columns tab, open the Properties… dialog box of the Quantity column, and select the Check content type option. In Type of column content, select Number.
Screenshot of the Quantity column properties in ABBYY FlexiLayout Studio, showing the Check content type option selected with Number chosen as the type of column content.
  1. Now if you match the FlexiLayout on the images, you will see that the Quantity column contains only digits, as required.
  2. Similarly, specify the Currency content for the UnitPrice and Total columns.
  3. To specify the location of the InvoiceTable block, select the Source element option. Click Browse button and specify InvoiceTable as the source element.