This page documents the Excel Export API and Interfaces.
Grid Properties
API Methods
export | Downloads an Excel export of the grid's data. |
get | Similar to exportDataAsExcel , except instead of downloading a file, it will return a Blob to be processed by the user. |
get | This is method to be used to get the grid's data as a sheet, that will later be exported either by getMultipleSheetsAsExcel() or exportMultipleSheetsAsExcel() . |
export | Downloads an Excel export of multiple sheets in one file. |
get | Similar to exportMultipleSheetsAsExcel , except instead of downloading a file, it will return a Blob to be processed by the user. |
Interfaces
ExcelExportParams
Properties available on the ExcelExportParams
interface.
add | Use to export an image for the gridCell in question.
|
all | If true , all columns will be exported in the order they appear in the columnDefs. When false only the columns currently being displayed will be exported. |
append | Content to put at the top of the exported sheet. An array of ExcelRow objects, see Extra Content section. |
author | The author of the exported file. @default "AG Grid" |
auto | If set to true , this will try to convert any cell that starts with = to a formula, instead of setting the cell value as regular string that starts with = . |
column | Provide a list (an array) of column keys or Column objects if you want to export specific columns.
|
column | Defines the default column width. If no value is present, each column will have value currently set in the application with a min value of 75px. This property can also be supplied a callback function that returns a number.
|
export | Used to add an Excel table to the spreadsheet. Set to true to use default export table config, or provide a config object. @default false |
exported | Determines whether rows are exported before being filtered and sorted. |
file | String to use as the file name or a function that returns a string. |
font | The default value for the font size of the Excel document. |
freeze | Use this property to select to freeze columns at the start of the grid (this will be the columns at the right for RTL). pinned - Freeze all pinned left (right for RTL grids) columns. true is returned. After that, this callback will no longer be executed. |
freeze | Use this property to select to freeze rows at the top of the exported sheet. headers - Freeze all grid headers at the top. headersAndPinnedRows - Freeze all headers and pinned top rows. true is returned, after that, this callback will no longer be executed. Note that using a callback will automatically freeze all header rows. |
get | A callback function to return content to be inserted below a row in the export. |
header | The configuration for header and footers.
|
header | The height in pixels of header rows. Defaults to Excel default value. This property can also be supplied a callback function that returns a number.
|
margins | The Excel document page margins. Relevant for printing.
|
mime | The mimeType of the Excel file. |
only | Export only selected rows. |
only | Only export selected rows including other pages (only makes sense when using pagination). |
page | Allows you to setup the page orientation and size.
|
prepend | Content to put at the bottom of the exported sheet. An array of ExcelRow objects, see Extra Content section. |
process | A callback function invoked once per cell in the grid. Return a string value to be displayed in the export. For example this is useful for formatting date values.
|
process | A callback function invoked once per column group. Return a string to be displayed in the column group header. Note that column groups are exported by default, this option will not work with skipColumnGroupHeaders=true .
|
process | A callback function invoked once per column. Return a string to be displayed in the column header.
|
process | A callback function invoked once per row group. Return a string to be displayed in the group cell.
|
right | Use to set the direction for the worksheet. true : Sets the direction to right-to-left (RTL). false : Sets the direction to left-to-right (LTR). undefined : Exports the worksheet according to the current direction of the grid as set by gridOptions.enableRtl . |
row | The expand/collapse state of each row group in the Excel Document. |
row | The height in pixels of all rows. Defaults to Excel default value. This property can also be supplied a callback function that returns a number.
|
row | Row node positions. |
sheet | The name of the sheet in Excel where the grid will be exported. Either a string or a function that returns a string can be used. If a function is used, it will be called once before the export starts. There is a max limit of 31 characters per sheet name. |
should | A callback function that will be invoked once per row in the grid. Return true to omit the row from the export.
|
skip | Set to true to exclude header column groups. |
skip | Set to true if you don't want to export column headers. |
skip | Set to true to suppress exporting rows pinned to the bottom of the grid. |
skip | Set to true to suppress exporting rows pinned to the top of the grid. |
skip | Set to true to skip row group headers if grouping rows. Only relevant when grouping rows. |
suppress | If true , the outline (controls to expand and collapse) for Group Columns will not be added automatically to the Excel Document. |
suppress | If true , the outline (controls to expand and collapse) for Row Groups will not be added automatically to the Excel Document. |
ExcelExportMultipleSheetParams
Properties available on the ExcelExportMultipleSheetParams
interface.
See Multiple Sheets for more information.
ExcelAlignment
Properties available on the ExcelAlignment
interface.
ExcelBorders
ExcelBorder
ExcelCell
ExcelData
ExcelFont
Properties available on the ExcelFont
interface.
ExcelHeaderFooterConfig
ExcelHeaderFooter
ExcelHeaderFooterContent
Properties available on the ExcelHeaderFooterContent
interface.
ExcelHeaderFooterImage
Properties available on the ExcelHeaderFooterImage
interface.
width * | The width of the image in pixels. |
height * | The height of the image in pixels. |
id * | The image id . This field is required so the same image doesn't get imported multiple times.
|
base64 * | A base64 string that represents the image being imported.
See: Base64 |
imageType * | The type of image being exported. |
recolor | Set this property to select a preset that changes the appearance of the image. |
brightness | The brightness of the image between 0 and 100 (if recolor is used, this value will only be applied for Grayscale ). Default 50 |
contrast | The contrast of the image between 0 and 100. (If recolor is used, this value will only be applied for Grayscale .). Default 50 |
alt | Alt Text for the image. |
ExcelImage
Properties available on the ExcelImage
interface.
id * | The image id . This field is required so the same image doesn't get imported multiple times.
|
base64 * | A base64 string that represents the image being imported.
See: Base64 |
imageType * | The type of image being exported. |
fit | If set to true , the image will cover the whole cell that is being imported to. This property does not apply to images in the Header/Footer |
transparency | Set a value between 0 - 100 that will indicate the percentage of transparency of the image. |
rotation | Set a value between 0 - 359 that will indicate the number of degrees to rotate the image clockwise. |
recolor | Set this property to select a preset that changes the appearance of the image. |
width | The width of the image in pixels. If this value is not selected, fitCell will be automatically set to true. |
height | The height of the image in pixels. If this value is not selected, fitCell will be automatically set to true. |
position | Position of the image. |
alt | Alt Text for the image. |
ExcelImagePosition
Properties available on the ExcelImagePosition
interface.
ExcelInterior
ExcelNumberFormat
ExcelProtection
ExcelSheetMargin
ExcelSheetPageSetup
ExcelTableConfig
Properties available on the ExcelTableConfig
interface.
ExcelStyle
Properties available on the ExcelStyle
interface.
Types
ExcelDataType
type ExcelDataType =
'String' |
'Formula' |
'Number' |
'Boolean' |
'DateTime' |
'Error'
ExcelOOXMLDataType
type ExcelOOXMLDataType =
'str' |
's' |
'f' |
'inlineStr' |
'n' |
'b' |
'd' |
'e' |
'empty'