Columns

The Excel Export component supports options for customization of the columns that will be exported to Excel.

You can specify the following column options:

Hidden State

To hide a particular column from the exported file, use the hidden column configuration.

To hide a particular columns from the exported file, you can also use conditional rendering.

Example
View Source
Edit In Stackblitz  
Change Theme:

Locked State

The Excel Export enables you to lock columns by using the locked property of the columns. As a result, you can display specific columns at all times while the user scrolls the Excel file.

Example
View Source
Edit In Stackblitz  
Change Theme:

Templates

The Excel Export supports templates that you can use for customizing the group and footer elements.

The templates must return text content. HTML elements cannot be converted to Excel column values.

Group Header Template

You can use the group header template to customize the header rows of the groups. To use a custom template set the groupHeader property to a Function or a React Component extending ExcelExportHeaderGroup.

The following additional fields are passed as props to the component, or through arguments to the function:

  • groupThe current group item.
  • fieldThe name of the field by which data is grouped.
  • valueThe current group value.
  • aggregatesAll aggregate values for the current group.

If a template is not specified, the group header content is set to " { title / field }: { value }".

Example
View Source
Edit In Stackblitz  
Change Theme:

You can use the group footer template to customize the footer rows of the groups. To use a custom template set the groupFooter property to a Function or a React Component extending ExcelExportFooterGroup.

The following additional fields are passed as props to the component, or through arguments to the function:

  • columnDefines an object of type ExcelExportColumnProps.
  • fieldThe current column field name.
  • groupThe current group data item.
  • aggregatesAll aggregate values for the current group.

If a template is not specified for any of the columns, the exported Excel file will not render a group footer row.

Example
View Source
Edit In Stackblitz  
Change Theme:

You can use the footer template to customize the column footer. To use a custom template set the footer property to a Function or a React Component extending ExcelExportFooter.

The following additional fields are passed as props to the component, or through arguments to the function:

If a template is not specified for any of the columns, the exported Excel file will not render a footer row.

Example
View Source
Edit In Stackblitz  
Change Theme:

Multi-Column Headers

The Excel Export supports multi-column headers by using column groups, which are defined declaratively by using the ExcelExportColumnGroup components, that incorporate inner column structures.

Example
View Source
Edit In Stackblitz  
Change Theme: