Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions docs/api/spreadsheet_exportmodulepath_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exportModulePath?: string;

~~~jsx {2}
const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
exportModulePath: "../libs/json2excel/1.0/worker.js",
exportModulePath: "../libs/json2excel/x.x/worker.js?vx", // a local path to the `worker.js` file of the export module
// other config parameters
});
~~~
Expand All @@ -31,14 +31,12 @@ const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
DHTMLX Spreadsheet uses the WebAssembly-based library [JSON2Excel](https://github.com/dhtmlx/json2excel) for export of data into Excel.
:::

To export files you need to:
To export files you need to set the path to the **worker.js** file of the [Json2Excel](https://github.com/dhtmlx/json2excel) library (where export will be processed) via the **exportModulePath** option. By default, `https://cdn.dhtmlx.com/libs/json2excel/next/worker.js?vx` is used.
- if you use the public export server, you don't need to specify the link to it, since it is used by default
- if you use your own export server, you need to:
- install the [**Json2Excel**](https://github.com/dhtmlx/json2excel) library
- use `"../libs/json2excel/x.x/worker.js?vx"` for a specific version (replace `x.x` with the version deployed on your server)

- install the **JSON2excel** library
- set the path to the **worker.js** file via the **exportModulePath** option in one of the two ways:
- by providing a local path to the file on your computer, like: `"../libs/json2excel/1.0/worker.js"`
- by providing a link to the file from CDN: `"https://cdn.dhtmlx.com/libs/json2excel/1.0/worker.js"`

By default the link to CDN is used.

**Related articles:** [Data loading and export](loading_data.md#exporting-data)

Expand Down
21 changes: 13 additions & 8 deletions docs/loading_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,18 +300,21 @@ DHTMLX Spreadsheet provides the ability to export data from a spreadsheet into a

#### How to export data

{{note Please note that the export feature won't work in the Internet Explorer browser.}}
:::note
Please note that the export feature won't work in the Internet Explorer browser.
:::

The library uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) to enable the functionality of export to Excel. Thus, to have the possibility of exporting files you need to:
The library uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) to enable the functionality of export to Excel. Export is processed at the **worker.js** file of the **Json2Excel** library (the default link is `https://cdn.dhtmlx.com/libs/json2excel/next/worker.js?vx`). You can use either the public export server or a local export server. Thus, to have the possibility of exporting files you need to:

- install the **JSON2Excel** library
- specify the [](api/spreadsheet_exportmodulepath_config.md) option in the Spreadsheet configuration and set the path to the **worker.js** file in one of the two ways:
- by providing a local path to the file on your computer, like: `"../libs/json2excel/1.0/worker.js"`
- by providing a link to the file from CDN: `"https://cdn.dhtmlx.com/libs/json2excel/1.0/worker.js"`
- specify the [](api/spreadsheet_exportmodulepath_config.md) option in the Spreadsheet configuration and set the path to the **worker.js** file:
- if you use the public export server, you don't need to specify the link to it, since it is used by default
- if you use your own export server, you need to:
- install the [**Json2Excel**](https://github.com/dhtmlx/json2excel) library
- use `"../libs/json2excel/x.x/worker.js?vx"` for a specific version (replace `x.x` with the version deployed on your server)

~~~jsx
var spreadsheet = new dhx.Spreadsheet(document.body, {
exportModulePath: "../libs/json2excel/1.0/worker.js"
exportModulePath: "../libs/json2excel/x.x/worker.js?vx" // the path to the export module, if a local export server is used
});
~~~

Expand All @@ -325,7 +328,9 @@ spreadsheet.export.xlsx();

**Related sample**: [Spreadsheet. Export Xlsx](https://snippet.dhtmlx.com/btyo3j8s?tag=spreadsheet)

{{note Please note that the component supports export to Excel files with the **.xlsx** extension only.}}
:::note
Please note that the component supports export to Excel files with the `.xlsx` extension only.
:::

#### How to set a custom name for an exported file

Expand Down
6 changes: 4 additions & 2 deletions docs/react/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ Enable sheet tabs with `multiSheets={true}`. Pass `false` to hide the tab bar en
~~~tsx
<ReactSpreadsheet
sheets={sheets}
importModulePath="../libs/excel2json/1.0/worker.js"
exportModulePath="../libs/json2excel/1.0/worker.js"
importModulePath="../libs/excel2json/next/worker.js"
exportModulePath="../libs/json2excel/next/worker.js"
/>
~~~

To use a specific version, replace `next` with the version number (check the [Excel2Json](https://github.com/dhtmlx/excel2json) and [Json2Excel](https://github.com/dhtmlx/json2excel) GitHub repositories).

### European number formatting

~~~tsx
Expand Down
Loading