You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`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
20
20
-`name?: string` - (optional) "grid" by default. The name of a ready Excel file
21
21
-`tableName?: string` - (optional) "data" by default. The name of a sheet with grid data in the Excel file
22
22
-`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)
Copy file name to clipboardExpand all lines: docs/grid/usage.md
+19-6Lines changed: 19 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -477,12 +477,15 @@ You can easily export data of Grid into the Excel, CSV, PDF, or PNG format.
477
477
478
478
#### Exporting data to Excel
479
479
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.
481
481
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:
485
483
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
486
489
~~~jsx
487
490
grid.export.xlsx({
488
491
url:"../libs/json2excel/1.3/worker.js?vx", // a local path to the export module
@@ -492,14 +495,24 @@ grid.export.xlsx({
492
495
});
493
496
~~~
494
497
495
-
:::note
496
498
You can check the latest version of the Json2Excel library at the [github repository](https://github.com/dhtmlx/json2excel).
497
-
:::
498
499
499
500
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).
500
501
501
502
**Related sample**: [Grid. Export to xlsx and csv](https://snippet.dhtmlx.com/58oqij47)
502
503
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
+
503
516
#### Exporting data to CSV
504
517
505
518
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).
Copy file name to clipboardExpand all lines: docs/migration.md
+16-10Lines changed: 16 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -11,27 +11,33 @@ description: You can explore how to migrate to newer versions in the documentati
11
11
12
12
### Grid
13
13
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
15
15
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.
17
17
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
19
23
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
21
25
// more export settings
22
26
});
23
27
~~~
24
28
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
26
34
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"
29
36
});
30
37
~~~
31
38
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.
0 commit comments