How can I add a new FormTableColumnHeaderDefinition to a FormTableDefinition object?


What are the best quality images to use when processing form data and recognition?


In order to add a new FormTableColumnHeaderDefinition to a FormTableDefinition object, first create a list of type FormTableColumnHeaderDefinition. Next, each FormTableColumnHeaderDefinition object is created and defined and added to this list using the Add method. Finally, this list is assigned to the FormTableDefinition’s ColumnHeaderDefinitions property.


// Create a table definition
FormTableDefinition tableDefinition = new FormTableDefinition();
tableDefinition.Name = "Line Item Table";

// Setup the columns of the table
List<FormTableColumHeaderDefinition> columnHeaderDefinitions = new List<FormTableColumnHeaderDefinition>();

FormTableColumnHeaderDefinition descriptionColumn = new FormTableColumnHeaderDefinition();
descriptionColumn.DataType = FormFieldDataType.GeneralText;
descriptionColumn.Name = "Description";

FormTableColumnHeaderDefinition amountColumn = new FormTableColumnHeaderDefinition();
amountColumn.DataType = FormFieldDataType.Currency;
amountColumn.Name = "Amount";

tableDefinition.ColumnHeaderDefinitions = columnHeaderDefinitions;

// Add the table definition to the form definition
formDefinition.TableDefinitions.Add(tableDefinition.Name, tableDefinition);