Dim wt As WorksheetTable = Me.ws.Tables.Add("F16:T29", True)
This topic provides procedural instructions on how to add a worksheet table to a worksheet using the Infragistics Excel Engine.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
The worksheet tables are a related data in the worksheet formatted in rows and columns. The data in a worksheet table can be managed independently from the data in the other rows and columns of the worksheet. Worksheet tables in the Infragistics Excel Engine are represented by the WorksheetTable class and are added in the worksheet’s Tables collection. This procedure demonstrates how to add a worksheet table to a worksheet.
To complete the procedure, you need the following:
An initialized workbook with at least one worksheet named "ws".
Following is a conceptual overview of the process:
Invoke the Add method of the Worksheet’s Tables collection
Specify table’s region
Specify if the table data contains headers
Specify table’s style (optional)
The following steps demonstrate how to add a table to a worksheet.
Invoke the Add method of the Worksheet’s Tables
collection. The next steps provide more information regarding the method’s arguments.
As first argument specify the region which should be occupied by the table. For example: "F16:T29". If your data have headers include the header cells in the region too.
As second argument specify if the specified region contains cells which should be used as table headers. Set this argument to true
if there are header cells in the region.
As third and optional argument you can specify a WorksheetTableStyle object to apply on the table.
The following code demonstrates how to add a worksheet table (which occupies the region "F16:T29" and has header cells in the top cells of this region) to the Tables
collection of a worksheet named "ws".
In Visual Basic:
Dim wt As WorksheetTable = Me.ws.Tables.Add("F16:T29", True)
In C#:
WorksheetTable wt = this.ws.Tables.Add("F16:T29", true);
The following table explains briefly the altering operations you may perform over the columns and rows of a worksheet table and maps them to the methods that configure them.
The following topics provide additional information related to this topic.