New classes are added to Infragistics Excel Engine to represent the newly supported structures. A collection of tables is exposed off the Worksheet class and collection of custom and standard table styles is exposed off the Workbook class.
A table in Microsoft Excel® is a named rectangular region of cells which contain related data organized into columns. A table also contains built in functionality which allows you to manage and analyze that data. In addition to its data, a table can also contain a row of headers and a row of totals for each column of data.
The following table summarizes the main features of the table support of Infragistics Excel Engine. Additional details are available after the summary table.
Worksheet Tables collection allows you to create and remove tables on the worksheet. In addition, you can get a table by name using
Workbook's GetTable method or by getting the
WorksheetCell AssociatedTable property of one of the cells within the table. Any tables in the
Worksheet.Tables collection will be saved with the file when the workbook is saved and will be visible on the worksheet in Microsoft Excel when that file is opened.
You can customize the newly created
WorksheetTable instance. The following behaviors are associated with table creation:
If a region with one row is formatted as a table and it has headers, meaning that there are no rows in the data area, the row below the headers will be an insert row. This means the cells in that row will return the table as their AssociatedTable value and they will be formatted with all the formatting contained in the table and its associated style.
Due to the fact that this expands the table to the cells in the row below, one of the following actions will be taken regarding the cells below the header row:
Each table has an associated style. This style is represented by the
WorksheetTableStyle class and is exposed on a table through the
WorksheetTable.Style property. The styles are exposed off the
Workbook class through three properties:
The table styles define many properties which allow you to control the appearance of tables at an area level (not an individual cell level).
There are 13 areas which can have a format applied with the table style. These are all optional formats, but when they are set, they are applied as differential formats. This means that only the formats values which are not default are seen in the cells. They are not directly applied to the cells though.
The cells maintain their own format and when set to non-default values, each format property of a cell will override the area formats from the table style. The following is a list of the 13 areas which can have a format applied, as defined by the
WorksheetTableStyleArea enumeration. They are exposed by the
WorksheetTableStyle AreaFormats collection and are listed here in order of precedence:
There is a similar
AreaFormats collection on the
WorksheetTable class which exposes formats for a different set of areas.
In addition to area formats, the table styles define how many columns each column stripe spans and how many rows each row stripe spans. These settings are exposed through the following properties:
If a table style is a custom table style which is later removed from the
CustomTableStyles collection, the table will have its style set back to the current
Each column of the table is represented by the
WorksheetTableColumn class and the columns within each table are exposed by the read-only
WorksheetTable.Columns collection. The table column only represents the portion of the column which exists in the table. By contrast, the entire column of a worksheet is represented by the
WorksheetColumn class and exposed by the
Table columns allow for various settings, which are listed in the table below:
The following topics provide additional information related to this topic.
The following samples provide additional information related to this topic.