Footer.kwTotal and are located on the same level.
Use elements of type Character String to detect the Total Quantity and the Total Amount fields. To specify the search constraints common to these elements, create a Group element — grTotal.
Create the grTotal Group element
To create the Group element grTotal:- In the Footer element, create a Group element and name it grTotal.
-
Select Optional element so that the search for the subelements stops if the name is absent.
For more information, see The Optional property of a Group element.
- Click the Advanced tab.
-
Since the Total Quantity and the Total Amount fields only occur on the image together with the name
Footer.kwTotal, set the following additional search constraint in the Advanced pre-search relations field: If theFooter.kwTotalelement has not been detected, do not look for the object on the image. In the FlexiLayout language:
If Footer.kwTotal.IsNull Then DontFind;
Create the TotalQuantity element
The Total Quantity field is located at the intersection of the Total row and the Quantity column. The first constraint was already specified at the Group element level. To specify the second constraint, use the previously detected column name as a reference element. To create the TotalQuantity element:- In the grTotal element, create an element of type Character String and name it TotalQuantity.
- Click the Character String tab.
-
In the Character count field, specify this fuzzy interval:
{-1, 1, 10, INF}. This is an estimate of the length of the character string. Assume that the possible values may range from 1 to 10. Any hypotheses outside this range will be penalized. - Leave the default values for the other parameters of the element.
- Click the Relations tab.
-
Since the Total Quantity field is always located on the same level as the keywords of the name
Footer.kwTotalor slightly lower, set the following search constraints:- Above the element
Footer.kwTotal, Offset = -200, Reference boundary = Bottom - Below the element
Footer.kwTotal, Offset = -20, Reference boundary = Top
- Above the element
- Click the Advanced tab.
-
Since the Total Quantity field is optional on the images but whenever it occurs it occurs together with the Quantity column and below its name, set the following additional search constraint in the Advanced pre-search relations field:
Look for the object on the image only if the
TableHeader.kwQuantityelement has been detected; Look no farther than 50 dots to the left or to the right of the respective boundaries of the column name. In the FlexiLayout language:
If Not (TableHeader.kwQuantity.IsNull) Then
{
LeftOf: TableHeader.kwQuantity.Right, -50 * dot;
RightOf: TableHeader.kwQuantity.Left, -50 * dot;
}
Else DontFind; - Try matching the FlexiLayout with the test images and make sure that the program successfully detects the element on all the images where applicable.
- To describe the location of the TotalQuantity block, select the Source element option, and then click ”…” and select the TotalQuantity element as the source element.
Create the TotalAmount element
The Total Amount field is located at the intersection of the Total row (the footer of the table) and the Total column. The first constraint was already specified at the Group element level. To specify the second constraint, use the previously detected column names as reference elements. To create the TotalAmount element:- In the grTotal element, create an element of type Character String and name it TotalAmount.
- Click the Character String tab.
-
In the Character count field, specify this fuzzy interval:
[-1, 1, 20, 2147483647]. This is an estimate of the length of the character string. Assume that the possible values may range from 1 to 20. Any hypotheses outside this range will be penalized. - Leave the default values for the other parameters of the element.
- Click the Relations tab.
-
Since the Total Amount field is always located on the same level as the keywords of the name
Footer.kwTotal, set the following search constraints:- Above the element
Footer.kwTotal, Offset = -20, Reference boundary = Bottom. - Below the element
Footer.kwTotal, Offset = -20, Reference boundary = Top.
- Above the element
- Click the Advanced tab.
-
Since the Total Amount field can only be located immediately below (possibly with a small shift) the name of the Total column and only between the Unit Price and Sales columns, set the following additional search constraint in the Advanced pre-search relations field:
If the
TableHeader.kwTotalelement has been detected, look for the object no farther than 70 dots to the right of the right boundary of theTableHeader.kwTotalelement and no farther than 50 dots to the left from the left boundary of theTableHeader.kwTotalelement. Or, if theTableHeader.kwUnitPriceandTableHeader.kwSaleselements are detected, look for the object no farther than 40 dots to the right of the left boundary of theTableHeader.kwSaleselement and to the right of the right boundary of theTableHeader.kwUnitPriceelement; otherwise do not look for the object. In the FlexiLayout language:
If Not (TableHeader.kwTotal.IsNull) Then
{
LeftOf: TableHeader.kwTotal.Right, -70 * dot;
RightOf: TableHeader.kwTotal.Left, -50 * dot;
}
Else
If Not (TableHeader.kwUnitPrice.IsNull) and Not (TableHeader.kwSales.IsNull) Then
{
LeftOf: TableHeader.kwSales.Left, -40 * dot;
RightOf: TableHeader.kwUnitPrice, 0 * dot;
}
Else DontFind; - Try matching the FlexiLayout with the test images and make sure that the program successfully detects the element on all the images where applicable.
-
To describe the location of the TotalAmount block, select the Source element option, and then click
and select the TotalAmount element as the source element.
