Skip to content

[Feature] - Support Tables and Table Styles during Export #975

@JustinGrote

Description

@JustinGrote

Feature Summary

Excel Tables aka SpreadsheetML Tables are a very powerful feature that are easily enabled just by adding them to the tables XML. MiniExcel already supports reading from tables, it should also support writing to tables. The default export mode should use a table rather than table-like stylings.

Document Formats

What document formats will benefit from this new functionality?

  • XLSX
  • CSV
  • XLSM
  • Other

Motivation

Utilize Tables in Excel Spreadsheets for easier pivot table, access via tools such as PowerBI, etc.

Proposed Solution

ExportAsync (and similar) take a TableName parameter (default Table1 if not specified), and update the TableStyle enum to include all the table styles (e.g. Medium2). Default Style should be TableStyleMedium2 which most closely matches the existing format. This could also be done in the OpenXMLConfiguration.

  • If exporting to an existing sheet and tablename is specifid, export to that table, erroring if the data format does not fit the existing column format.

Alternatives Considered

Currently opening and adding the table via ClosedXML as a workaround after export.

Willing to attempt PR if accepted

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions