The foldering can be used to summarize data at different levels. In this example the invoice total is summarized per
supplier and for the complete batch. You can find the script needed for the summarization below the figure showing a batch with two
folders having each two documents.
During server processing the
BeforeExtract and
AfterExtract for each folder field and for each folder are fired. These events can be used analogously to
the document processing for setting field values like in the following example: Summarizing the a specific document field of all
documents in a folder and writing this sum to a folder field.
Private Sub SupplierTotal_BeforeExtract(pXFolder As CASCADELib.CscXFolder, pField As CASCADELib.CscXFolderField, pSkip As Boolean)
Dim i As Long
Dim dSupplierTotal As Double
For i = pXFolder.DocInfos.Count - 1 To 0 Step -1
dSupplierTotal = dSupplierTotal + pXFolder.DocInfos(i).XDocument.Fields.ItemByName("Total").DoubleValue
Next i
pField.Text = CStr(dSupplierTotal)
pField.ExtractionConfident = True
End Sub
During validation a different event is needed to keep this folder field up to date. Use the event AfterFieldConfirmed of
the ValidationForm object to update the folder field data from the document data.
Private Sub ValidationForm_AfterFieldConfirmed(pXDoc As CASCADELib.CscXDocument, pField As CASCADELib.CscXDocField)
If pField.Name = "Total" Then
pXDoc.ParentFolder.Fields.ItemByName("SupplierTotal").Text = Format(RecalculateTotal(pXDoc),"#.###,00")
End If
End Sub
Private Function RecalculateTotal(pXDoc As CASCADELib.CscXDocument) As Double
Dim oXDocInfo As CASCADELib.CscXDocInfo
Dim n As Integer
RecalculateTotal = 0
For n = 0 To pXDoc.ParentFolder.DocInfos.Count - 1
Set oXDocInfo = pXDoc.ParentFolder.DocInfos(n)
RecalculateTotal = RecalculateTotal + oXDocInfo.XDocument.Fields.ItemByName("Total")
Next n
End Function
Search results
Search tips
The search returns topics that contain terms you enter. If you type more than one term, an OR is assumed, which returns topics where any of the terms are found. Enclose your search terms in quotes for exact-phrase matching.
The search also uses fuzzy matching to account for partial words (such as install and installs). The results appear in order of relevance, based on how many search terms occur per topic. Exact matches are highlighted.
To refine the search, you can use the following operators:
Type + in front of words that must be included in the search or - in front of words to exclude. (Example: user +shortcut –group finds shortcut and user shortcut, but not group or user group.)
Use * as a wildcard for missing characters. The wildcard can be used anywhere in a search term. (Example: inst* finds installation and instructions.)
Type title: at the beginning of the search phrase to look only for topic titles. (Example: title:configuration finds the topic titled “Changing the software configuration.”)
For multi-term searches, you can specify a priority for terms in your search. Follow the term with ^ and a positive number that indicates the weight given that term. A higher number indicates more weight. (Example: shortcut^10 group gives shortcut 10 times the weight as group.)
To use fuzzy searching to account for misspellings, follow the term with ~ and a positive number for the number of corrections to be made. (Example: port~1 matches fort, post, or potr, and other instances where one correction leads to a match.)
Note that operators cannot be used as search terms: + - * : ~ ^ ' "