WebDataRocks End User License Agreement (“Agreement”) has been revised and is effective as of April 18, 2024.
The following modifications have been made:
The modified version of WebDataRocks End User License Agreement is available here.
Downloading, installing, and/or continuing to use WebDataRocks after April 18, 2024, constitutes your acceptance of the terms and conditions of the modified version of WebDataRocks End User License Agreement. If you do not agree to any of these terms and conditions, do not download, install, use, or access (or continue to access) WebDataRocks.
exportTo(exportType:String, parameters:Object, callback:Function|String)
Exports the content from the grid to Excel, PDF or HTML. Such an export file can be saved both locally and to a server.
Name | Type | Description |
---|---|---|
exportType | String | One of the following export types: "excel" , "pdf" or "html" . |
parameters | Object | optional Describes export parameters. Can have the following properties: |
| String | optional The name of the export file. The default name is pivot . |
| String | optional Destination for the download. By default, destinationType is set to "file" , which means the export file is saved locally. Set destinationType as "server" to save the export file to the server. |
| String | optional The URL to the server script saving the export file. It is required when saving the export file to the server (the export file is passed as a POST parameter). |
| String | optional Property to set custom sheet name when exporting to Excel. |
| Boolean | optional If true, shows the filters in exported Excel file. |
| String | optional Only for PDF and HTML export. HTML string added to the export file as a header. For example, "<div>##CURRENT-DATE##</div>" . |
| String | optional Only for PDF and HTML export. HTML string added to the export file as a footer. For example, "<div>##CURRENT-DATE##</div>" . |
| String | optional Page orientation for PDF file. By default, pageOrientation is set to "portrait" , which means the export file is saved in portrait mode. Set pageOrientation as "landscape" to save the export file in landscape mode. |
callback | Function | String | optional Callback handler, which is called after the export process is finished. |
1) Export content to Excel or PDF:
2) Export content to PDF with a custom header, save it to a server and add a callback:
webdatarocks.exportTo( "pdf", { header:"<div>##CURRENT-DATE##</div>", destinationType: "server", url: "URL to server script saving the file" }, function () { console.log("Export process is finished"); } );