Report Format Type - Excel

View as Markdown

Summary

  • Excel exports produce a downloadable workbook (Clipboard is not available for this format)
  • Requires AG Grid's ExcelExportModule
  • Use excelSheetName in Export Options for the default worksheet name; use exportReport + exportConfig.exportParams for one-off AG Grid Excel params

The most commonly used Report Format Type is Excel, where the exported data can be opened in Excel.

Caution

This option is only available if the ExcelExportModule AG Grid Module is loaded

When using this option only the downloadable File System Export Destination is available (i.e. the data cannot be sent to the Clipboard).

Hint

Users are able to create a Custom Export Destination, e.g S3, and then export the Excel formatted data there

Excel sheet name

By default AdapTable names the worksheet Sheet 1. Set excelSheetName in Export Options to change that for every Excel or Visual Excel export.

excelSheetName

Default: 'Sheet 1'
string | ((excelSheetNameContext: BaseExportContext) => string)
Worksheet name when exporting to Excel

Notes

Notes are exported as cell comments, including the Note's Author.

Excel shows the same indicator for every comment, so the Note Type cannot be shown as a colour. Instead, when any Note has a type other than the default (noteOptions.defaultNoteType, Info unless changed), each exported comment starts with its type, e.g. Warning: Check this price.

If all Notes have the default type, the comment contains only the Note text.

Excel Column Types

AdapTable allows developers to define in AG Grid columns which have a particular Excel Data Type.

This ensures that Excel will render that column using the correct type.

Caution

  • This only affects the behaviour in Excel for exported data
  • There is no impact on how AdapTable (or AG Grid) renders the Column or formats the Cells

There are 4 types of Column Data Types supported:

  • numberExcelType
  • stringExcelType
  • dateExcelType
  • booleanExcelType

These are configured using the cellClass property in the ColDef object (which is an array), e.g:

cellClass: ["stringExcelType"]

Caution

This can very occasionally result in the column losing any formatting which it has been given in AdapTable

Excel Column Type
Fork
  • In this example we configure 2 Columns with Excel Column Types:
    • Rating - has a stringExcelType
    • Price - has a numberExcelType
Try It Out
  • Export to Excel and note that the Price column is of type Number and the Rating column shows all values as strings
Loading demo…