Report Format Types - Visual Excel
Summary
Reports in AdapTable are not WYSIWYG (What You See is What You Get).
It is the Grid's underlying raw data, rather than display values, styles or grouping, which is exported.
Note
- Developers do, however, have some control over the Formatting of other Reports
- They can set how to format dates and choose between exporting cell raw (the default) or display values
The one exception to this "data-only" rule is the VisualExcel Report Format Type.
This exports Columns that contain styles so that they appear in Excel the same way as they do in AdapTable.
The VisualExcel Report Format Type includes the following elements:
- defined in AG Grid:
- Value Getters
- Cell Formatters
- defined in AdapTable:
- Formatted Columns (which contain AdapTable Styles)
- Row Groups
Exporting Styles
AdapTable will export styles that have been created in AG Grid or AdapTable into Excel format.
This means that if there are any AG Grid Excel Styles defined, Adaptable will try to render them.
Caution
Any AdapTable Styles defined with the Format Column will always take precedence over AG Grid styles
Hint
- We recommend using AdapTable's versatile Format Columns instead of AG Grid's standard value formatters
- It offers ingrained styling support for Excel and ensures the Format Column definition is the sole source of truth
- In this example AdapTable has been set to use the
VisualExcelReport Format Type (andCurrent Layoutreport) - We added a number of features which all get included in the Export:
- Switch to
Grouped Layout- note how the Column Formats are preserved
Exporting Formats
The VisualExcel Report Format always exports any Display Formats currently rendered in AdapTable.
Caution
- The
exportDataFormatproperty in Export Options evaluates whether to export raw value or display value - But (only) the
VisualExcelReport Format Type ignores this since it only exports display values
Exporting Excel Dates
When using the VisualExcel Report Format Type, Date columns can be explicitly exported as Excel Date cells.
Hint
This means that Excel will see the Column as a Date and treat it as such when providing Filters and other functionality
To achieve this, the following are required:
-
the Column has a Cell Data Type of
date -
a custom Date format is provided. This can be either:
- set using the (global)
exportDateFormatproperty in Export Options; or - via the
exportDataFormatproperty in Export Options which is set toformattedValuefor Dates
Note
This option also requires the Column to have an active Format Column using
DateFormatterOptions - set using the (global)
Exporting Styled Columns
The VisualExcel Report Format Type will only export the Gradient Style Styled Column.
This is because it simply contains a back colour which is easy to send to Excel.
Caution
The VisualExcel Report Format Type will not export Percent Bar or Badge or Sparkline Column Styled Columns