Validation is the last operation and is actually a manual operation in the process. At this point you have to accept the results, edit or reject them. Setting the "UserValidated" flag in Fields and Tables validates them. This flag is also used in template processing to give greater preference to these "validated" values and locations.
In all the below examples:
The field data and label location values can be set with the following methods:
and
These methods will set the bounding area for the specified Data/Label. They also set the text value by selecting any text in the bounding area on the specified page. In the event that the returned value is not correct, the Data/Label value can be overridden. The area of the Data/Label should be set even if the values are overridden.
Example - demonstrates the use of SetData/SetLabel methods |
Copy Code |
---|---|
// Set the data area formResult.Fields[itemIndex].SetData(docPageIndex, boundingBoxForData, false); // Set the label area formResult.Fields[itemIndex].SetLabel(docPageIndex, boundingBoxForLabel, false); |
Example - demonstrates overriding the Data/Label values |
Copy Code |
---|---|
// Set the data value formResult.Fields[itemIndex].Data.Value = "My Data Value"; // Set the label value formResult.Fields[itemIndex].Data.Value = "My Label Value"; |
The Form Fields is not validated though until the UserValidated has been set.
Copy Code | |
---|---|
// Set the user validated flag formResult.Fields[itemIndex].UserValidated = true; |
Before validation the Form Tables components may be changed with the following method calls:
FormTable.SetColumnHeader |
Columns are selected using the FormTable. SetColumnHeader method. This method selects the area of the column header. The area should span the width of the specified column.
| ||||||||
FormTable.InsertRow |
Rows can be added to the table by using the FormTable.InsertRow method. This method takes the top and bottom of the row and fills in the data cells defined by the column headers.
| ||||||||
FormTable.SetCell |
The FormTable.SetCell method is used to change the location and value of a cell. Changing an individual cell is similar to changing the Data value of a form field.
|
After all modifications have been made to the table, set the FormTable.UserValidated flag to true.
Example |
Copy Code |
---|---|
// Set to validated formResult.Tables[0].UserValidated = true; |