React Data Grid: Excel Export API Reference
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. Default: false | |
| 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:
| 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 = .Default: false | |
| 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: (params: ColumnWidthCallbackParams) => number . | |
| For backwards compatibility, this property could be set to xml , which will export an Excel Spreadsheet compatible with old Office versions (prior to Office 2007). Setting this to xml is not recommended as some features will not work in legacy mode.Default: 'xlsx' Options: 'xlsx' , 'xml' | |
| The default value for the font size of the Excel document. Default: 11 | |
| 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: (params: RowHeightCallbackParams) => number . | |
| 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: (params: RowHeightCallbackParams) => number . | |
| The name of the sheet in Excel where the grid will be exported. There is a max limit of 31 characters. Default: 'ag-grid' | |
| Content to put at the top of the exported sheet. A 2D array of ExcelCell objects (see Extra Content section). | |
| Content to put at the bottom of the exported sheet. A 2D array of ExcelCell objects (see Extra Content section). | |
| 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.Default: false | |
| Provide a list (an array) of column keys or Column objects if you want to export specific columns. | |
| String to use as the file name. Default: 'export.xlsx' | |
| Export only selected rows. Default: false | |
| Only export selected rows including other pages (only makes sense when using pagination). Default: false | |
| The Excel document page margins. Relevant for printing. | |
| The mimeType of the Excel file. Note that this defaults to application/vnd.ms-excel if exportMode is xml .Default: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | |
| Allows you to setup the page orientation and size. | |
| If true , text content will be encoded with XML character entities like < and > . This is only relevant when exportMode='xml' .Default: false | |
| Set to true to exclude header column groups.Default: false | |
| Set to true if you don't want to export column headers.Default: false | |
| Set to true to skip row group headers if grouping rows. Only relevant when grouping rows.Default: false | |
| Set to true to suppress exporting rows pinned to the bottom of the grid.Default: false | |
| A callback function to return content to be inserted below a row in the export.
| |
| A callback function that will be invoked once per row in the grid. Return true to omit the row from the export. | |
| 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. Return a string to be displayed in the column header. | |
| 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 row group. Return a string to be displayed in the group cell. | |
| A callback function invoked once per cell. Return an ExcelImage object to add an image to the current cell.
|
ExcelExportMultipleSheetParams:
| The author of the exported file. Default: 'AG Grid' | |
| 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() . See Multiple Sheets. | |
| String to use as the file name. Default: 'export.xlsx' | |
| The default value for the font size of the Excel document. Default: 11 | |
| The mimeType of the Excel file Default: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
ExcelCell
| The data that will be added to the cell. | |
| The ExcelStyle id to be associated with the cell. | |
| The number of cells to span across (1 means span 2 columns) Default: 0 |
ExcelData
ExcelImage
| 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. See more info about Base64/ | |
| The type of image being exported. Options: 'jpg' , 'png' , 'gif' | |
| If set to true , the image will cover the whole cell that is being imported to.Default: false | |
| Set a value between 0 - 100 that will indicate the percentage of transparency of the image. Default: 0 | |
| Set a value between 0 - 359 that will indicate the number of degrees to rotate the image clockwise. Default: 0 | |
| Set this property to select a preset that changes the appearance of the image. Options: 'Grayscale' , 'Sepia' , 'Washout' | |
| 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. | |
| See position for more details. |
position
excelImage > position
ExcelStyle
ExcelAlignment
ExcelBorders
| 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
ExcelFont
ExcelInterior
ExcelNumberFormat
| Use this property to provide a pattern to format a number. (eg. 10000 could become $10,000.00). |
ExcelProtection
| Set to false to disable cell protection (locking)Default: true | |
| Set to true to hide formulas within protected cellsDefault: false |
ExcelSheetMargin
ExcelSheetPageSetup
ExcelHeaderFooterConfig
| 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
| 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
Types
ExcelDataType
type ExcelDataType = 'String' | 'Formula' | 'Number' | 'Boolean' | 'DateTime' | 'Error'
ExcelOOXMLDataType
type ExcelOOXMLDataType = 'str' | 's' | 'f' | 'inlineStr' | 'n' | 'b' | 'd' | 'e' | 'empty'
- Excel Export API Reference
- Grid Properties
- API Methods
- Interfaces
- ExcelExportParams:
- ExcelExportMultipleSheetParams:
- ExcelCell
- ExcelData
- ExcelImage
- ExcelStyle
- ExcelAlignment
- ExcelBorders
- ExcelBorder
- ExcelFont
- ExcelInterior
- ExcelNumberFormat
- ExcelProtection
- ExcelSheetMargin
- ExcelSheetPageSetup
- ExcelHeaderFooterConfig
- ExcelHeaderFooter
- ExcelHeaderFooterContent
- Types
- ExcelDataType
- ExcelOOXMLDataType