This page documents the Excel Export API and Interfaces.
Grid Properties
A default configuration object used to export to Excel. |
Prevents the user from exporting the grid to Excel. |
A list (array) of Excel styles to be used when exporting to Excel with styles. |
API Methods
Downloads an Excel export of the grid's data. |
Similar to exportDataAsExcel , except instead of downloading a file, it will return a Blob to be processed by the user. |
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() . |
Downloads an Excel export of multiple sheets in one file. |
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.
Use to export an image for the gridCell in question.
|
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. |
Content to put at the top of the exported sheet. An array of ExcelRow objects, see Extra Content section. |
The author of the exported file. @default "AG Grid" |
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 = . |
Provide a list (an array) of column keys or Column objects if you want to export specific columns.
|
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.
|
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 |
Determines whether rows are exported before being filtered and sorted. |
String to use as the file name or a function that returns a string. |
The default value for the font size of the Excel document. |
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. |
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. |
A callback function to return content to be inserted below a row in the export. |
The configuration for header and footers.
|
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.
|
The Excel document page margins. Relevant for printing.
|
The mimeType of the Excel file. |
Export only selected rows. |
Only export selected rows including other pages (only makes sense when using pagination). |
Allows you to setup the page orientation and size.
|
Content to put at the bottom of the exported sheet. An array of ExcelRow objects, see Extra Content section. |
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.
|
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 .
|
A callback function invoked once per column. Return a string to be displayed in the column header.
|
A callback function invoked once per row group. Return a string to be displayed in the group cell.
|
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 . |
The expand/collapse state of each row group in the Excel Document. |
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 node positions. |
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. |
A callback function that will be invoked once per row in the grid. Return true to omit the row from the export.
|
Set to true to exclude header column groups. |
Set to true if you don't want to export column headers. |
Set to true to suppress exporting rows pinned to the bottom of the grid. |
Set to true to suppress exporting rows pinned to the top of the grid. |
Set to true to skip row group headers if grouping rows. Only relevant when grouping rows. |
If true , the outline (controls to expand and collapse) for Group Columns will not be added automatically to the Excel Document. |
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.
Array of strings containing the raw data for Excel workbook sheets. This property is only used when exporting to multiple sheets using api.exportMultipleSheetsAsExcel() and the data for each sheet is obtained by calling api.getSheetDataForExcel() .
|
The index of the sheet to be marked as active by default. |
String to use as the file name or a function that returns a string. |
The author of the exported file. @default "AG Grid" |
The default value for the font size of the Excel document. |
The mimeType of the Excel file. |
ExcelAlignment
Properties available on the ExcelAlignment
interface.
Use this property to change the cell horizontal alignment. |
Use this property to change the level of indentation in the cell. |
Use this property to change the cell reading order. |
The number of degrees between 0 and 359 to rotate the text. |
If set to true , the font size of the cell will automatically change to force the text to fit within the cell. |
Use this property to change the cell vertical alignment. |
If set to true , multiline text will be displayed as multiline by Excel. |
ExcelBorders
Properties available on the ExcelBorders
interface.
Use to set the cell's bottom border. |
Use to set the cell's left border. |
Use to set the cell's right border. |
Use to set the cell's top border. |
ExcelBorder
Properties available on the ExcelBorder
interface.
The color or the border. |
The style of the border. |
The thickness of the border from 0 (thin) to 3 (thick). |
ExcelCell
Properties available on the ExcelCell
interface.
The data that will be added to the cell. |
Cell reference. |
Collapsible ranges. |
The ExcelStyle id to be associated with the cell. |
The number of cells to span across (1 means span 2 columns). |
ExcelData
Properties available on the ExcelData
interface.
The type of data being in the cell. |
The value of the cell. |
ExcelFont
Properties available on the ExcelFont
interface.
Set to true to set the cell text to bold. |
The color of the cell font. |
The family of the font to used in the cell. Options: Automatic ,Roman ,Swiss ,Modern ,Script ,Decorative , |
The name of the font to be used in the cell. |
Set to true to display the cell font as italic. |
Set to true to add a text outline. |
Set to true to add text shadow. |
Set this property to used a different font size other than the default.
|
Set to true to add a strikeThrough line. |
Use this property to underline the cell text.
|
Use this property to change the default font alignment. Note: This is different than setting cell vertical alignment. |
ExcelHeaderFooterConfig
Properties available on the ExcelHeaderFooterConfig
interface.
The configuration for header and footer on every page. |
The configuration for header and footer on the first page only. |
The configuration for header and footer on even numbered pages only. |
ExcelHeaderFooter
Properties available on the ExcelHeaderFooter
interface. At least one of header or footer is required or both.
An array of maximum 3 items ( Left , Center , Right ), containing header configurations. |
An array of maximum 3 items ( Left , Center , Right ), containing footer configurations. |
ExcelHeaderFooterContent
Properties available on the ExcelHeaderFooterContent
interface.
The value of the text to be included in the header. |
When value is &[Picture] , this should be used as the referenced image.
|
Configures where the text should be added: Left , Center or Right . |
The font style of the header/footer value. |
ExcelHeaderFooterImage
Properties available on the ExcelHeaderFooterImage
interface.
The width of the image in pixels. |
The height of the image in pixels. |
The image id . This field is required so the same image doesn't get imported multiple times.
|
A base64 string that represents the image being imported.
|
The type of image being exported. |
Set this property to select a preset that changes the appearance of the image. |
The brightness of the image between 0 and 100 (if recolor is used, this value will only be applied for Grayscale ). Default 50 |
The contrast of the image between 0 and 100. (If recolor is used, this value will only be applied for Grayscale .). Default 50 |
Alt Text for the image. |
ExcelImage
Properties available on the ExcelImage
interface.
The image id . This field is required so the same image doesn't get imported multiple times.
|
A base64 string that represents the image being imported.
|
The type of image being exported. |
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 |
Set a value between 0 - 100 that will indicate the percentage of transparency of the image. |
Set a value between 0 - 359 that will indicate the number of degrees to rotate the image clockwise. |
Set this property to select a preset that changes the appearance of the image. |
The width of the image in pixels. If this value is not selected, fitCell will be automatically set to true. |
The height of the image in pixels. If this value is not selected, fitCell will be automatically set to true. |
Position of the image. |
Alt Text for the image. |
ExcelImagePosition
Properties available on the ExcelImagePosition
interface.
The row containing this image. This property is set automatically, don't change it unless you know what you are doing. |
The amount of rows this image will cover. @default 1 |
The column containing this image. This property is set automatically, don't change it unless you know what you are doing. |
The amount of columns this image will cover. |
The amount in pixels the image should be offset horizontally. |
The amount in pixels the image should be offset vertically. |
ExcelInterior
Properties available on the ExcelInterior
interface.
Use this property to set background color patterns. |
The colour to be used as a secondary colour combined with patterns. |
The pattern color. |
ExcelNumberFormat
Properties available on the ExcelNumberFormat
interface.
Use this property to provide a pattern to format a number. (eg. 10000 could become $10,000.00). |
ExcelProtection
Properties available on the ExcelProtection
interface.
Set to false to disable cell protection (locking) |
Set to true to hide formulas within protected cells. |
ExcelSheetMargin
Properties available on the ExcelSheetMargin
interface.
The sheet top margin. |
The sheet right margin. |
The sheet bottom margin. |
The sheet left margin. |
The sheet header margin. |
The sheet footer margin. |
ExcelSheetPageSetup
Properties available on the ExcelSheetPageSetup
interface.
Use this property to change the print orientation. |
Use this property to set the sheet size. |
ExcelTableConfig
Properties available on the ExcelTableConfig
interface.
This property is used to set the table name. It should be an alphanumeric string with no special characters. |
Set this property to false to disable the filter button at the exported Excel table header. Set it to true to show the filter button on all columns. Set it to match to show the filter button only if the column has a filter allowed. |
Set this property to false to hide the row stripes. |
Set this property to true to show column stripes. |
Set this property to true to show the first column in bold/highlighted style. |
Set this property to true to show the last column in bold/highlighted style. |
ExcelStyle
Properties available on the ExcelStyle
interface.
The id of the Excel Style, this should match a CSS cell class. |
Use this property to customise cell alignment properties. |
Use this property to customise cell borders. |
Use this property to specify the type of data being exported. |
Use this property to customise the font used in the cell. |
Use this property to customise the cell background. |
Use this property to customise the cell value as a formatted number. |
Use this property to setup cell protection. |
Types
ExcelDataType
type ExcelDataType =
'String' |
'Formula' |
'Number' |
'Boolean' |
'DateTime' |
'Error'
ExcelOOXMLDataType
type ExcelOOXMLDataType =
'str' |
's' |
'f' |
'inlineStr' |
'n' |
'b' |
'd' |
'e' |
'empty'