Skip to content

Commit 489e8f7

Browse files
committed
[update] grid data export guides
1 parent 22d4f04 commit 489e8f7

File tree

4 files changed

+30
-32
lines changed

4 files changed

+30
-32
lines changed

docs/grid/api/export/grid_csv_method.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description: You can explore the csv export method of Grid in the documentation
1313
@params:
1414
- `config` - (optional) an object with export settings. You can specify the following settings for export to CSV:
1515
- `asFile?: boolean` - (optional) defines whether Grid should be exported to a file, *true* by default. To export Grid only as a CSV string, you need to set *asFile:false*
16-
- `name?: string` - (optional) the name of the exported CSV file (if asFile is not set to *false*)
16+
- `name?: string` - (optional) "grid" by default. The name of the exported CSV file (if asFile is not set to *false*)
1717
- `rowDelimiter?: string` - (optional) a newline ("\n") by default. A separator between rows, can be a tab - "\t", or any other value
1818
- `columnDelimiter?: string` - (optional) a comma (",") by default. A separator between columns, can be a semicolon - ";", or any other value
1919

@@ -26,9 +26,9 @@ grid.export.csv();
2626

2727
// export with config settings
2828
grid.export.csv({
29-
name:"grid_data", // grid data will be exported to a CSV file named "grid_data"
30-
rowDelimiter: "\t", // the tab delimiter will be used to separate rows
31-
columnDelimiter: ";" // the semicolon delimiter will be used to separate columns
29+
name: "my_file", // the name of a ready CSV file
30+
rowDelimiter: "\t", // the delimiter used to separate rows
31+
columnDelimiter: ";" // the delimiter used to separate columns
3232
});
3333

3434

docs/grid/api/export/grid_xlsx_method.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,21 @@ 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) the link to the **worker.js** file of the [Json2Excel](https://github.com/dhtmlx/json2excel) library where export will be processed
20-
- `name?: string` - (optional) the name of a ready Excel file
21-
- `tableName?: string` - (optional) the name of a sheet with grid data in the Excel file
22-
- `dateFormatMask?: string` - (optional) 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)
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"`
20+
- `name?: string` - (optional) "grid" by default. The name of a ready Excel file
21+
- `tableName?: string` - (optional) "data" by default. The name of a sheet with grid data in the Excel file
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)
2323

2424
@example:
2525
// default export
2626
grid.export.xlsx();
2727

2828
// export with config settings
2929
grid.export.xlsx({
30-
// a local path to the `worker.js` file of the Json2Excel library
31-
url: "../libs/json2excel/1.3/worker.js?vx",
32-
name: "my_file",
33-
tableName: "grid",
34-
dateFormatMask: "mm.dd.yy"
30+
url: "../libs/json2excel/1.3/worker.js?vx", // a local path to the `worker.js` file of the export module
31+
name: "my_file", // the name of a ready Excel file
32+
tableName: "grid", // the name of a sheet with grid data in the Excel file
33+
dateFormatMask: "mm.dd.yy" // the date format mask for Excel
3534
});
3635

3736
@descr:

docs/grid/usage.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -481,35 +481,34 @@ DHTMLX Grid uses the WebAssembly-based library [Json2Excel](https://github.com/d
481481

482482
- install the [Json2Excel](https://github.com/dhtmlx/json2excel) library
483483
- 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 with the provided settings (all settings are optional)
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)
485485

486486
~~~jsx
487487
grid.export.xlsx({
488-
// a local path to the `worker.js` file of the Json2Excel library
489-
url: "../libs/json2excel/1.3/worker.js?vx",
490-
name: "my_file", // the name of a ready Excel file
491-
tableName: "grid", // the name of a sheet with grid data in the Excel file
492-
dateFormatMask: "mm.dd.yy" // the mask used for dates formatting in Excel
488+
url: "../libs/json2excel/1.3/worker.js?vx", // a local path to the export module
489+
name: "my_file", // the name of a ready Excel file, "grid" by default
490+
tableName: "grid", // the name of a sheet with grid data in the Excel file, "data" by default
491+
dateFormatMask: "mm.dd.yy" // the date format mask for Excel, "dd/mm/yy" by default
493492
});
494493
~~~
495494

496495
:::note
497496
You can check the latest version of the Json2Excel library at the [github repository](https://github.com/dhtmlx/json2excel).
498497
:::
499498

500-
You can 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).
499+
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).
501500

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

504503
#### Exporting data to CSV
505504

506-
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.
505+
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).
507506

508507
~~~jsx
509508
grid.export.csv({
510-
name:"grid_data", // grid data will be exported to a CSV file named "grid_data"
511-
rowDelimiter: "\t", // the tab delimiter will be used to separate rows
512-
columnDelimiter: ";" // the semicolon delimiter will be used to separate columns
509+
name: "my_file", // the name of a ready CSV file, "grid" by default
510+
rowDelimiter: "\t", // the delimiter used to separate rows, "\n" (newline) by default
511+
columnDelimiter: ";" // the delimiter used to separate columns, "," (comma) by default
513512
});
514513
~~~
515514

@@ -519,26 +518,26 @@ The `csv()` method returns a CSV string with Grid data.
519518

520519
#### Exporting data to PDF
521520

522-
The [`pdf()`](grid/api/export/grid_pdf_method.md) method of the Export module allows you to export data from Grid into a PDF file. The method takes an object with export settings as a parameter.
521+
The [`pdf()`](grid/api/export/grid_pdf_method.md) method of the Export module allows you to export data from Grid into a PDF file. The method takes an [object with export settings](grid/api/export/grid_pdf_method.md) as a parameter (all settings are optional).
523522

524523
~~~jsx
525524
grid.export.pdf({
526-
format: "A4",
527-
scale: 0.75,
528-
displayHeaderFooter: true,
529-
theme: "dark",
525+
format: "A4", // the format of the output file, "A4" by default
526+
scale: 0.75, // the scale of the grid rendering (between 0.1 and 2)
527+
displayHeaderFooter: true, // defines whether to display the header and footer, false by default
528+
theme: "dark" // the exported theme, "light" by default
530529
});
531530
~~~
532531

533532
**Related sample**: [Grid. Export to PDF/PNG](https://snippet.dhtmlx.com/ti9l91mn)
534533

535534
#### Exporting data to PNG
536535

537-
The [`png()`](grid/api/export/grid_png_method.md) method of the Export module allows you to export data from Grid into a PNG file. The method takes an object with export settings as a parameter.
536+
The [`png()`](grid/api/export/grid_png_method.md) method of the Export module allows you to export data from Grid into a PNG file. The method takes an [object with export settings](grid/api/export/grid_png_method.md) as a parameter (all settings are optional).
538537

539538
~~~jsx
540539
grid.export.png({
541-
theme: "dark",
540+
theme: "dark" // the exported theme, "light" by default
542541
});
543542
~~~
544543

docs/whatsnew.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Released on June X, 2025
4040

4141
- Grid. The logic and appearance of the [drag-n-drop functionality](grid/configuration.md/#drag-n-drop) is improved. Check the [related sample](https://snippet.dhtmlx.com/uevdwjuo)
4242
- Grid. The [export to Excel](grid/usage.md/#exporting-data-to-excel) functionality is updated. The [Json2Excel](https://github.com/dhtmlx/json2excel) module is now used for exporting Grid data to Excel. Check the [Migration guide](migration.md/#91---92) for details
43-
- Grid. The [`xlsx()`](grid/api/export/grid_xlsx_method.md) method of the Export module gets two new properties:
43+
- Grid. The [`xlsx()`](grid/api/export/grid_xlsx_method.md) method of the Export module gets two new configuration settings:
4444
- `tableName`- to set the name of a sheet with grid data in the Excel file
4545
- `dateFormatMask` - to set the date format mask for Excel
4646
- Grid. The possibility to use keyboard navigation for [selecting ranges of cells](grid/configuration.md/#shortcut-keys-for-selecting-ranges-of-cells). The following shortcut keys and their combinations are available:

0 commit comments

Comments
 (0)