6.5
© 2007 ABBYY. All rights reserved.
59
The pageDefName and fieldName arguments specify the field array (the fieldName field for each page matched with the
pageDefName template in the form document).
The function returns the sum of the array elements.
Empty summands are regarded as 0.
ASumProduct
Function ASumProduct(ByVal pageDefName, ByVal fieldName1, ByVal fieldName2)
The pageDefName, fieldName1 and fieldName2 specify two arrays of the same dimension (the array dimension is equal to the
number of the pages matched with the pageDefName template in the form document).
The function returns the cum of the element–by–elements products of the fieldName1 and filedName2 arays.
Empty fields (array elements) are regarded as 0.
ACount
Function ACount(ByVal pageDefName)
The function returns the number of pages matched with the pageDefName templates in the form document.
ACountNotEmpty
Function ACountNotEmpty(ByVal pageDefName, ByVal fieldName)
The function returns the number of the fieldName fields that were filled in the pages matched with the pageDefName template in
the form document.
AMin*/AMax*
Function AMinNum(ByVal pageDefName, ByVal fieldName)
Function AMinDate(ByVal pageDefName, ByVal fieldName)
Function AMinText(ByVal pageDefName, ByVal fieldName)
Function AMaxNum(ByVal pageDefName, ByVal fieldName)
Function AMaxDate(ByVal pageDefName, ByVal fieldName)
Function AMaxText(ByVal pageDefName, ByVal fieldName)
The function returns the minimal (maximal) value of the corresponding type for the fieldName fields of all the pages matched with
the pageDefName template.
The empty fields are not compared
If the fieldName fields of all the pages matched with the pageDefName template are empty, the function returns Variant(Empty).
When calculating the field values, the program checks that each field has the value of the appropriate type (IsNumeric(Variant),
IsDate(Variant)) or is empty (IsEmpty()).
AFirst/ALast
Function AFirst(ByVal pageDefName, ByVal fieldName)
Function ALast(ByVal pageDefName, ByVal fieldName)
AFirst returns the fields value of the first document page of the specified type.
ALast returns the fields value of the last document page of the specified type.
Example of using the Form Data Access API
Option Explicit
' Sums the values of the fieldName field on all pageDefName pages
Function ASum( pageDefName, fieldName )
Dim sum, pages, i
sum = 0
Set pages = Form.GetPagesForTemplate( pageDefName )
For i = 1 To pages.Count
Dim fieldValue
fieldValue = pages.Item( i ).Fields.ItemByName( fieldName ).ToDecimal()
If Not IsNull( fieldValue ) Then
sum = sum + fieldValue
End If
Next
ASum = sum
End Function
How to modify the script
The scripts cannot be modified automatically in ABBYY FormReader Enterprise Edition.
When renaming fields and pages in the ABBYY FormReader Enterprise Edition interface, the user must change the name of these
objects in the script.
Automation Export
Automation export (or custom export) is a custom export procedure development kit that provides software control over data export
via an Automation interface (Automation API).
Custom export procedure
An example of a custom export procedure is installed together with the Administration and Correction Stations (refer to
<Installation folder>\Enterprise\Samples\CustomExport).










