SmartZone ICR allows you to provide a list of expected data contents. If you know potential actual values, providing that information will make your recognition results more accurate.
To improve recognition using a Data Validation List, set the FieldType property of the Reader class to DataValidationList. To populate the data validation list call the DataValidationListAddEntry method of the Reader class for every valid value.
DataValidationListRemoveEntry will remove an entry from the data validation list.
DataValidationListClear will remove all entries from the data validation list.
To examine the data validation list, call DataValidationListCount to get the number of entries in the data validation list. DataValidationListGetAt will return the entries at that index. So, by calling DataValidationListGetAt with index value of zero to DataValidationListCount, you can get every entry in the data validation list.
Example - Clear a data validation list and add from a checkbox list. |
Copy Code |
---|---|
//Clear previous DVL smartZoneICR1.Reader.DataValidationListClear(); //Add new ones for (int i = 0; i < checkedListBoxDVL.Items.Count; i++) { object curritem = checkedListBoxDVL.Items[i]; if (checkedListBoxDVL.CheckedItems.Contains(curritem)) { smartZoneICR1.Reader.DataValidationListAddEntry(curritem.ToString()); } } |
Using a Data Validation list provides additional feedback on recognition by way of the returned FieldType value. For example, a regular string will return a FieldType of GeneralText. When a DataValidation list is used, if the recognized value matches a value in the list, the FieldType of DataValidationList is returned. Otherwise, the FieldType of Unknown is returned, indicating that the recognized value was not in the list.
Practical uses of Data Validation lists are:
var stateList = new List<String>() { "AL", "AK", "AZ" ... };