- Header of the table. As decided earlier, specify column names using already detected auxiliary elements.
- 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.
- 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:- In the SearchElements tree, create an element of type Table and name it InvoiceTable.
- Click the Columns tab.
- Click Select to select the InvoiceTable block created earlier in Step 3 as the block to search for.
- 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 detectedTableHeader.kwReferenceelement. To use it, select Use found element as column name, and then click
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 detectedTableHeader.kwDesignationelement. - In the list of columns, select Unit and click the Properties… button.
For the name of this column, use the previously detectedTableHeader.kwUnitelement. - In the list of columns, select Quantity and click the Properties… button.
For the name of this column, use the previously detectedTableHeader.kwQuantityelement. - In the list of columns, select UnitPrice and click the Properties… button.
For the name of this column, use the previously detectedTableHeader.kwUnitPriceelement. - In the list of columns, select Total and click the Properties… button.
For the name of this column, use the previously detectedTableHeader.kwTotalelement.
- In the list of columns, select Reference and click the Properties… button.
- Click the Order tab.
- 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.
- Click the Header tab. The Header of the table is needed, but no additional constraints are imposed, so keep the default values.
- Click the Footer tab. Use the previously detected element
InvoiceFooter.Paragraphfor the final part of the table. Select the Use found element as footer option, click
and then select the InvoiceFooter.Paragraphelement.
- Click the Rows tab.
-
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
button to select these columns.
-
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.kwSaleselement, Offset = 0
- Left of the
-
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. -
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.
- Now if you match the FlexiLayout on the images, you will see that the Quantity column contains only digits, as required.
- Similarly, specify the Currency content for the UnitPrice and Total columns.
- To specify the location of the InvoiceTable block, select the Source element option. Click
and specify InvoiceTable as the source element.
