All docs
V19.2
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
19.1
18.2
18.1
17.2
Box
Row
Map
Vue
A newer version of this page is available. Switch to the current version.

jQuery DataGrid - export

Configures client-side exporting.

Type:

Object

When client-side exporting is enabled, the grid toolbar contains the Export button ( DevExtreme DataGrid HTML5 Toolbar Exporting ) that exports grid data to Excel. For details on exporting, refer to the Client-Side Exporting article.

NOTE
Client-side exporting requires the JSZip library. Learn where you can get it from topics in the Installation section.

View Demo

allowExportSelectedData

Allows an end user to export selected rows only.

Type:

Boolean

Default Value: false

When this option is set to true, a click on DevExtreme DataGrid HTML5 Toolbar Exporting invokes a menu that contains the "Export selected rows" command.

DevExtreme DataGrid Exporting Selected Rows

See Also
  • export.texts.exportSelectedRows - customizes the text of the "Export selected rows" command.
  • selection.mode - enables selection in the widget.

customizeExcelCell

Customizes an Excel cell after it is created.

Type:

Function

Function parameters:
options:

Object

Excel cell settings.

Object structure:
Name Type Description
backgroundColor

String

The cell background color specified as a "#RRGGBBAA" value.
R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (0-9, A-F). A is optional.

component

DataGrid

The widget's instance.

fillPatternColor

String

The foreground color of the cell fill pattern specified as a "#RRGGBBAA" value.
R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (0-9, A-F). A is optional.

fillPatternType 'darkDown' | 'darkGray' | 'darkGrid' | 'darkHorizontal' | 'darkTrellis' | 'darkUp' | 'darkVertical' | 'gray0625' | 'gray125' | 'lightDown' | 'lightGray' | 'lightGrid' | 'lightHorizontal' | 'lightTrellis' | 'lightUp' | 'lightVertical' | 'mediumGray' | 'none' | 'solid'

The cell fill pattern.

font

ExcelFont

The cell font.

gridCell

ExcelDataGridCell

A DataGrid cell that corresponds to the Excel cell.

horizontalAlignment 'center' | 'centerContinuous' | 'distributed' | 'fill' | 'general' | 'justify' | 'left' | 'right'

The horizontal cell alignment.

numberFormat

String

The format that specifies how the cell value is displayed.
Refer to the Review guidelines for customizing a number format article for more information.
Note that you should use " instead of " to include a text entry. For example, the 0.0" items" format results in 5 exported as 5 items.

value

String

|

Number

|

Date

The cell value.

verticalAlignment 'bottom' | 'center' | 'distributed' | 'justify' | 'top'

The vertical cell alignment.

wrapTextEnabled

Boolean

Specifies whether the cell text should be line-wrapped.

The following table shows available fill patterns:

Fill Pattern Result
"darkDown"
"darkGray"
"darkGrid"
"darkHorizontal"
"darkTrellis"
"darkUp"
"darkVertical"
"gray0625"
"gray125"
Fill Pattern Result
"lightDown"
"lightGray"
"lightGrid"
"lightHorizontal"
"lightTrellis"
"lightUp"
"lightVertical"
"mediumGray"
"solid"

enabled

Enables the client-side exporting.

Type:

Boolean

Default Value: false

NOTE
Client-side exporting requires the JSZip library. Learn where you can get it from topics in the Installation section.

View Demo

See Also

excelFilterEnabled

Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file.

Type:

Boolean

Default Value: false

excelWrapTextEnabled

Specifies whether to enable word wrapping for the exported data in the resulting XLSX file.

Type:

Boolean

Default Value: undefined

When this option is not set, the value of the grid's wordWrapEnabled option is used.

fileName

Specifies a default name for the file to which grid data is exported.

Type:

String

Default Value: 'DataGrid'

ignoreExcelErrors

Specifies whether Excel should hide warnings if there are errors in the exported document.

Type:

Boolean

Default Value: true

proxyUrl Deprecated

IMPORTANT
Since v10, Safari browser supports API for saving files, and this option is no longer required.

Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable exporting in the Safari browser.

Type:

String

Default Value: undefined

Generally, exporting is performed using client-side API in browsers. However, the Safari (integrated in Mac OS) browser does not implement an API for saving files. In this instance, the DataGrid widget can POST the content to a server-side proxy, which will stream the file back to the end user. To enable this functionality, set the export.proxyUrl option to the proxy, which will stream the file to the end user. When implementing the proxy, take the following information into account.

  • Your proxy will receive a POST request with the following parameters in the request body: fileName, contentType (the MIME type of the file) and base64 (the base-64 encoded file content).
  • The proxy should return the decoded file with the "Content-Disposition" header set to attachment; filename="".

The sample proxy implementation for ASPx-based and PHP-based web servers is described in the Set up a Server-Side Proxy article.

texts

Configures the texts of export commands, buttons, and hints.

Type:

Object