Skip to content

Commit a9c7c84

Browse files
committed
[update] docs for export to excel for v9.2
1 parent ec36244 commit a9c7c84

File tree

3 files changed

+36
-17
lines changed

3 files changed

+36
-17
lines changed

docs/grid/api/export/grid_xlsx_method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DHTMLX Grid uses the WebAssembly-based library [Json2Excel](https://github.com/d
1616

1717
@params:
1818
- `config` - (optional) an object with export settings. You can specify the following settings for export to Excel:
19-
- `url?: string` - (optional) a local path to the **worker.js** file of the [Json2Excel](https://github.com/dhtmlx/json2excel) library (where export will be processed) set as `"../libs/json2excel/1.3/worker.js?vx"`
19+
- `url?: string` - (optional) the path to the **worker.js** file of the [Json2Excel](https://github.com/dhtmlx/json2excel) library (where export will be processed) set as `"../libs/json2excel/1.3/worker.js?vx"`, if the local export server is used. The path to the public export server is used by default
2020
- `name?: string` - (optional) "grid" by default. The name of a ready Excel file
2121
- `tableName?: string` - (optional) "data" by default. The name of a sheet with grid data in the Excel file
2222
- `dateFormatMask?: string` - (optional) "dd/mm/yy" by default. The mask used for [dates formatting in Excel](https://support.microsoft.com/en-us/office/format-a-date-the-way-you-want-in-excel-8e10019e-d5d8-47a1-ba95-db95123d273e)

docs/grid/usage.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,15 @@ You can easily export data of Grid into the Excel, CSV, PDF, or PNG format.
477477

478478
#### Exporting data to Excel
479479

480-
DHTMLX Grid uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) to enable the export to Excel functionality and the [`xlsx()`](grid/api/export/grid_xlsx_method.md) method of the `Export` module to export data from Grid into an Excel file. Thus, to have the possibility of exporting files you need to:
480+
Since v9.2 DHTMLX Grid uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) to enable the export to Excel functionality and the [`xlsx()`](grid/api/export/grid_xlsx_method.md) method of the `Export` module to export data from Grid into an Excel file. You can use either the public export server or a local export server.
481481

482-
- install the [Json2Excel](https://github.com/dhtmlx/json2excel) library
483-
- if you need to set a local path to the export module on your computer, specify the `url` option in the configuration object of the [`xlsx()`](grid/api/export/grid_xlsx_method.md) method and set the path to the **worker.js** file like: `"../libs/json2excel/1.3/worker.js?vx"`. If the local path isn't set, the link to the file from CDN will be used
484-
- call the [`xlsx()`](grid/api/export/grid_xlsx_method.md) method of the `Export` module. The method takes an [object with export settings](grid/api/export/grid_xlsx_method.md) as a parameter (all settings are optional)
482+
Thus, to have the possibility of exporting files you need to:
485483

484+
- call the [`xlsx()`](grid/api/export/grid_xlsx_method.md) method of the `Export` module. The method takes an [object with export settings](grid/api/export/grid_xlsx_method.md) as a parameter (all settings are optional)
485+
- if you use the public export server, you don't need to specify the link to it, since it is used by default
486+
- if you use your own export server, you need to:
487+
- install the [Json2Excel](https://github.com/dhtmlx/json2excel) library
488+
- provide a local path to the export module on your computer by setting the path to the **worker.js** file as `"../libs/json2excel/1.3/worker.js?vx"`, as a value of the `url` option in the configuration object of the [`xlsx()`](grid/api/export/grid_xlsx_method.md) method
486489
~~~jsx
487490
grid.export.xlsx({
488491
url: "../libs/json2excel/1.3/worker.js?vx", // a local path to the export module
@@ -492,14 +495,24 @@ grid.export.xlsx({
492495
});
493496
~~~
494497

495-
:::note
496498
You can check the latest version of the Json2Excel library at the [github repository](https://github.com/dhtmlx/json2excel).
497-
:::
498499

499500
Read the details on dates formatting in Excel in the [related Excel documentation](https://support.microsoft.com/en-us/office/format-a-date-the-way-you-want-in-excel-8e10019e-d5d8-47a1-ba95-db95123d273e).
500501

501502
**Related sample**: [Grid. Export to xlsx and csv](https://snippet.dhtmlx.com/58oqij47)
502503

504+
:::note
505+
The export module server used in the Suite versions up to v9.1 is still available. You can either set the path to the public export server as:
506+
507+
~~~jsx
508+
grid.export.xlsx({
509+
url: "//export.dhtmlx.com/excel"
510+
});
511+
~~~
512+
513+
or provide a local path to the export module on your computer as a value of the `url` property of the export method.
514+
:::
515+
503516
#### Exporting data to CSV
504517

505518
You can export data from Grid to the CSV format with the [`csv()`](grid/api/export/grid_csv_method.md) method of the Export module. The method takes an [object with export settings](grid/api/export/grid_csv_method.md) as a parameter (all settings are optional).

docs/migration.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,33 @@ description: You can explore how to migrate to newer versions in the documentati
1111

1212
### Grid
1313

14-
Since v9.2 the Grid component uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) for [exporting Grid data to an Excel file](grid/usage.md/#exporting-data-to-excel). By default, you don't need to specify the link to the export module.
14+
#### Export to Excel module update
1515

16-
However, if you use your own export server, you need to install the **Json2Excel** library and provide the local path to the export module on your computer by setting the path to the **worker.js** file as `"../libs/json2excel/1.3/worker.js?vx"`:
16+
Since v9.2 the Grid component uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) for [exporting Grid data to an Excel file](grid/usage.md/#exporting-data-to-excel). As earlier, you can use either the public export server or a local export server.
1717

18-
~~~jsx title="Before v9.2"
18+
##### From v9.2
19+
20+
The link to the public export server is used by default, so you don't need to specify it. If you use your own export server, you need to install the **Json2Excel** library and provide the local path to the export module on your computer by setting the path to the **worker.js** file as `"../libs/json2excel/1.3/worker.js?vx"`:
21+
22+
~~~jsx
1923
grid.export.xlsx({
20-
url: "https://export.dhtmlx.com/excel", // optional, the link to the export module
24+
url: "../libs/json2excel/1.3/worker.js?vx", // the path to the export module, if a local export server is used
2125
// more export settings
2226
});
2327
~~~
2428

25-
~~~jsx title="From v9.2"
29+
##### Up to v9.1
30+
31+
The previously used export module server is still available for the Suite versions up to v9.1. You can either set the path to the public export server as:
32+
33+
~~~jsx
2634
grid.export.xlsx({
27-
url: "../libs/json2excel/1.3/worker.js?vx", // optional, a local path to the export module
28-
// more export settings
35+
url: "//export.dhtmlx.com/excel"
2936
});
3037
~~~
3138

32-
:::info
33-
The previously used export module server is still available for the Suite versions up to v9.1.
34-
:::
39+
or provide a local path to the export module on your computer as a value of the `url` property of the export method.
40+
3541

3642
9.0 -> 9.1
3743
-----------

0 commit comments

Comments
 (0)