TableConfig

This element organizes questions and answers in a tabular structure (rows and columns) for better readability.

Tables are best suited for large surveys where all questions have the same set of answers.

Declaration

TableConfig element is declared as an instance of TableConfig class. Reference Aspose.OMR.Generation.Config.Elements.Table, Aspose.OMR.Generation.Config.Elements and Aspose.OMR.Generation.Config.Enums namespaces to use TableConfig types without specifying the fully qualified namespace:

using Aspose.OMR.Generation.Config.Elements;
using Aspose.OMR.Generation.Config.Elements.Table;
using Aspose.OMR.Generation.Config.Enums;

The number of answers common to all questions in the table is provided in AnswersCount property.

TableConfig element includes an optional TableTitleConfig element, TableHeaderConfig element and one or more QuestionConfig elements provided in children property.

new TableConfig() {
	AnswersCount = 3,
	Children = new List<BaseConfig>() {
		/*
		 * Put table structure elements here
		 */
	}
}

Table structure

Required properties

Name Type Description
AnswersCount int The number of answers common to all questions in the table
Children List<BaseConfig> A list including the TableTitleConfig object, TableHeaderConfig object and one or more QuestionConfig objects representing the table structure.

Optional properties

Name Type Default value Description
Name string n/a Used as an element’s identifier and as a reminder of the element’s purpose in template source; for example, "Satisfaction survey".
This text is not displayed on the form.
TableType TableType TableType.None Table style:
  • TableType.None - standard table
  • TableType.Striped - zebra-striped table rows
  • TableType.EqualCells - make all table columns equal

TableTitleConfig element

This optional element defines the title row of the table. If TableTitleConfig element is omitted, the table will be rendered without a title row.

TableTitleConfig element is declared as an instance of TableTitleConfig class.

Title text is provided in the Name property.

new TableTitleConfig() {
	Name = "Table title"
}

Required properties

Name Type Description
Name string Table title text.

Optional properties

Name Type Default value Description
FontFamily string “Segoe UI” The font family for the title text.
FontStyle FontStyle FontStyle.Regular The font style for the title text.
Several font styles can be combined with \| operator, for example FontStyle.Bold \| FontStyle.Italic.
FontSize int 12 Font size for the title text.
Color Color Color.Black Color of the title text.
BackgroundColor Color transparent Background color of the title row.
BorderType BorderType BorderType.None Whether to draw a border around the title row.
  • BorderType.None - no border.
  • BorderType.Square - draw a rectangular border.
  • BorderType.Rounded - draw a rectangular border with rounded corners.
BorderSize int 3 Width of the title row borders.
BorderColor Color Color.Black Color of the title row borders.
BorderTopStyle object inherits border_size and border_color Override the width and color of the element’s top border. Provided as the object with the following properties:
  • BorderSize - top border width, integer;
  • BorderColor - top border color, Color object;
  • Disable - specify true to remove the top border, Boolean.
BorderBottomStyle object inherits border_size and border_color Override the width and color of the element’s bottom border. Provided as the object with the following properties:
  • BorderSize - bottom border width, integer;
  • BorderColor - bottom border color, Color object;
  • Disable - specify true to remove the bottom border, Boolean.
BorderLeftStyle object inherits border_size and border_color Override the width and color of the element’s left border. Provided as the object with the following properties:
  • BorderSize - left border width, integer;
  • BorderColor - left border color, Color object;
  • Disable - specify true to remove the left border, Boolean.
BorderRightStyle object inherits border_size and border_color Override the width and color of the element’s right border. Provided as the object with the following properties:
  • BorderSize - right border width, integer;
  • BorderColor - right border color, Color object;
  • Disable - specify true to remove the right border, Boolean.

TableHeaderConfig element

This element specifies the content of the table header row.

TableHeaderConfig element is declared as an instance of TableHeaderConfig class.

TableHeaderConfig element includes a ContentConfig object that defines the question text and several TableAnswerConfig objects that define the answers in the Children list.

new TableHeaderConfig() {
	Children = new List<BaseConfig>() {
		/*
		 * Put ContentConfig element and child elements here
		 */
	}
}

Required properties

Name Type Description
Children List<BaseConfig> ContentConfig object that defines the question text and several TableAnswerConfig objects that define the answers
The number of TableAnswerConfig objects must be equal to the value of the AnswersCount property of the TableConfig element.

Optional properties

Name Type Default value Description
FontFamily string “Segoe UI” The font family for the table header text.
FontStyle FontStyle FontStyle.Regular The font style for the table header text.
Several font styles can be combined with \| operator, for example FontStyle.Bold \| FontStyle.Italic.
FontSize int 12 Font size for the table header text.

TableAnswerConfig element

The TableAnswerConfig element defines the answer text that will be displayed in the table header. The number of TableAnswerConfig elements must be equal to the value of the AnswersCount property of the TableConfig element.

TableAnswerConfig element is declared as an instance of TableAnswerConfig class.

Answer text is provided in the Name property.

new TableAnswerConfig() {
	Name = "Answer"
}
Required properties
Name Type Description
Name string Answer text.

QuestionConfig element

The QuestionConfig element defines the question text. A TableConfig can include multiple question elements that will be displayed as rows.

QuestionConfig element is declared as an instance of QuestionConfig class.

Question text is provided in the Name property.

new QuestionConfig() {
	Name = "Question"
}

Required properties

Name Type Description
Name string Question text.

Examples

Check out the code examples to see how tables can be used.

Product satisfaction survey

TemplateConfig templateConfig = new TemplateConfig() {
	Children=new List<BaseConfig>() {
		new PageConfig() {
			Children = new List<BaseConfig>() {
				new ContainerConfig() {
					Children = new List<BaseConfig>() {
						new BlockConfig() {
							Children = new List<BaseConfig>() {
								new TableConfig() {
									Name = "Survey",
									AnswersCount = 3,
									TableType = TableType.Striped,
									Children = new List<BaseConfig>() {
										new TableTitleConfig() {
											Name = "Product satisfaction survey",
											FontSize = 16,
											FontStyle = FontStyle.Bold
										},
										new TableHeaderConfig() {
											FontSize = 10,
											FontStyle = FontStyle.Italic,
											Children = new List<BaseConfig>() {
												new ContentConfig() {
													Name = "Question"
												},
												new TableAnswerConfig() {
													Name = "Yes"
												},
												new TableAnswerConfig() {
													Name = "No"
												},
												new TableAnswerConfig() {
													Name = "I don't know"
												}
											}
										},
										new QuestionConfig() {
											Name = "Is Aspose.OMR for .NET easy to use?"
										},
										new QuestionConfig() {
											Name = "Are you satisfied with Aspose.OMR for .NET performance?"
										},
										new QuestionConfig() {
											Name = "Are you satisfied with Aspose.OMR for .NET recognition accuracy?"
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
};

Product satisfaction survey

Checklist

TemplateConfig templateConfig = new TemplateConfig() {
	Children=new List<BaseConfig>() {
		new PageConfig() {
			Children = new List<BaseConfig>() {
				new ContainerConfig() {
					Children = new List<BaseConfig>() {
						new BlockConfig() {
							Children = new List<BaseConfig>() {
								new TableConfig() {
									Name = "Checklist",
									AnswersCount = 1,
									Children = new List<BaseConfig>() {
										new TableHeaderConfig() {
											FontSize = 10,
											FontStyle = FontStyle.Italic,
											Children = new List<BaseConfig>() {
												new ContentConfig() {
													Name = "Step"
												},
												new TableAnswerConfig() {
													Name = ""
												}
											}
										},
										new QuestionConfig() {
											Name = "Download Microsoft Visual Studio"
										},
										new QuestionConfig() {
											Name = "Create a new C# project"
										},
										new QuestionConfig() {
											Name = "Install Aspose.OMR for .NET NuGet package"
										},
										new QuestionConfig() {
											Name = "Get a trial license"
										},
										new QuestionConfig() {
											Name = "Enjoy"
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
};

Checklist