In This Topic
Tables are essential to depict large amounts of data in an organized way. DsExcel supports using Excel tables in template layouts where various operations can also be performed on it like filtering, sorting etc.
This template example lists sales information for different areas grouped as a list. The template cells are defined within the table layout.
The below image displays a template layout where a table is used and template cells are defined inside the table. You can also download the Excel template layout from here.
After DsExcel processes the template layout, the Excel report will look like below:
An Excel table can be incorporated in a template layout in two ways:
- Template cells inside an Excel table: You can insert a table in Excel's template layout and define template cells inside it, as shown in above screenshot. The table is resized according to the expanded data after processing the template in DsExcel.
- Excel table inside a template cell’s range: You can define a template cell with Range property and insert a table anywhere within that range. The table is copied according to the expansion data after processing the template in DsExcel.
Note: Table formulas are also supported in template cells.
Limitations
- In DsExcel Templates, the default group type is "Merge", which is not supported in case of tables. Hence, you should explicitly set the group type to any other value except "Merge".
- Excel table inside a template cell’s range: The complete range of table should be included in the template cell’s Range property. For example, if a table occurs in the range C5:D8, the template cell should have the "Range(R)" property, for example: {{ds.Area(R=C5:D8)}}, to include table inside cell range C5:D8.
However, for sheet name template, any table in the current sheet is included by default. So, it doesn't need to set "Range" property.
- Template cells inside an Excel table: If sheet name template is also used along with table, there might be layout issues while expanding the template and the table might be moved to an incorrect location. Hence, you should convert table to cell range before processing.