Footer.kwTotal name and on the same level.
Use elements of type Character String to detect the Total Quantity and Total Amount fields. To set the search constraints common to both, create a Group element named grTotal.
Create the grTotal group element
1
Create the Group element
In the Footer element, create a Group element and name it grTotal.
2
Make the group optional
Select Optional element so that the search for subelements stops if the name is absent. For more information, see The Optional property of a Group element.
3
Add the search constraint
Click the Advanced tab. The Total Quantity and Total Amount fields occur only together with the
Footer.kwTotal name, so set this additional search constraint in the Advanced pre-search relations field: if the Footer.kwTotal element was not detected, do not look for the object. In the FlexiLayout language:Create the TotalQuantity element
The Total Quantity field sits at the intersection of the Total row and the Quantity column. You already set the first constraint at the Group element level. To set the second constraint, use the previously detected column name as a reference element.1
Create the Character String element
In the grTotal element, create an element of type Character String and name it TotalQuantity.
2
Set the character count
Click the Character String tab. In the Character count field, specify this fuzzy interval:
{-1, 1, 10, INF}. This estimates the length of the character string; assume values range from 1 to 10. Any hypothesis outside this range is penalized.Leave the default values for the element’s other properties.3
Set the position constraints
Click the Relations tab. The Total Quantity field always sits on the same level as the
Footer.kwTotal name keywords or slightly lower, so set these search constraints:- Above the
Footer.kwTotalelement, Offset = -200, Reference boundary = Bottom - Below the
Footer.kwTotalelement, Offset = -20, Reference boundary = Top
4
Add the column constraint
Click the Advanced tab. The Total Quantity field is optional, but whenever it occurs it appears together with the Quantity column and below its name. Set this additional search constraint in the Advanced pre-search relations field: look for the object only if the
TableHeader.kwQuantity element was detected, and look no farther than 50 dots to the left or right of the column name’s respective boundaries. In the FlexiLayout language:5
Verify the match
Match the FlexiLayout with the test images and confirm that FlexiLayout Studio detects the element on every image where it occurs.
6
Set the block source element
To describe the location of the TotalQuantity block, select Source element, click
, and select the TotalQuantity element as the source element.
Create the TotalAmount element
The Total Amount field sits at the intersection of the Total row (the footer of the table) and the Total column. You already set the first constraint at the Group element level. To set the second constraint, use the previously detected column names as reference elements.1
Create the Character String element
In the grTotal element, create an element of type Character String and name it TotalAmount.
2
Set the character count
Click the Character String tab. In the Character count field, specify this fuzzy interval:
[-1, 1, 20, 2147483647]. This estimates the length of the character string; assume values range from 1 to 20. Any hypothesis outside this range is penalized.Leave the default values for the element’s other properties.3
Set the position constraints
Click the Relations tab. The Total Amount field always sits on the same level as the
Footer.kwTotal name keywords, so set these search constraints:- Above the
Footer.kwTotalelement, Offset = -20, Reference boundary = Bottom - Below the
Footer.kwTotalelement, Offset = -20, Reference boundary = Top
4
Add the column constraint
Click the Advanced tab. The Total Amount field appears immediately below the name of the Total column (possibly with a small shift), between the Unit Price and Sales columns. In the Advanced pre-search relations field, set an additional search constraint that covers two cases:
- If
TableHeader.kwTotalwas detected, look for the object no more than 70 dots right of its right boundary and no more than 50 dots left of its left boundary. - Otherwise, if
TableHeader.kwUnitPriceandTableHeader.kwSaleswere detected, look for the object no more than 40 dots right of the left boundary ofTableHeader.kwSales, and right of the right boundary ofTableHeader.kwUnitPrice. If neither case applies, do not look for the object.
5
Verify the match
Match the FlexiLayout with the test images and confirm that FlexiLayout Studio detects the element on every image where it occurs.
6
Set the block source element
To describe the location of the TotalAmount block, select Source element, click
, and select the TotalAmount element as the source element.
