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
Copy file name to clipboardExpand all lines: docs/grid/api/export/grid_csv_method.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ description: You can explore the csv export method of Grid in the documentation
13
13
@params:
14
14
-`config` - (optional) an object with export settings. You can specify the following settings for export to CSV:
15
15
-`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*)
17
17
-`rowDelimiter?: string` - (optional) a newline ("\n") by default. A separator between rows, can be a tab - "\t", or any other value
18
18
-`columnDelimiter?: string` - (optional) a comma (",") by default. A separator between columns, can be a semicolon - ";", or any other value
19
19
@@ -26,9 +26,9 @@ grid.export.csv();
26
26
27
27
// export with config settings
28
28
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
-`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)
23
23
24
24
@example:
25
25
// default export
26
26
grid.export.xlsx();
27
27
28
28
// export with config settings
29
29
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
- install the [Json2Excel](https://github.com/dhtmlx/json2excel) library
483
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 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)
485
485
486
486
~~~jsx
487
487
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
493
492
});
494
493
~~~
495
494
496
495
:::note
497
496
You can check the latest version of the Json2Excel library at the [github repository](https://github.com/dhtmlx/json2excel).
498
497
:::
499
498
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).
501
500
502
501
**Related sample**: [Grid. Export to xlsx and csv](https://snippet.dhtmlx.com/58oqij47)
503
502
504
503
#### Exporting data to CSV
505
504
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).
507
506
508
507
~~~jsx
509
508
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
513
512
});
514
513
~~~
515
514
@@ -519,26 +518,26 @@ The `csv()` method returns a CSV string with Grid data.
519
518
520
519
#### Exporting data to PDF
521
520
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).
523
522
524
523
~~~jsx
525
524
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
530
529
});
531
530
~~~
532
531
533
532
**Related sample**: [Grid. Export to PDF/PNG](https://snippet.dhtmlx.com/ti9l91mn)
534
533
535
534
#### Exporting data to PNG
536
535
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).
538
537
539
538
~~~jsx
540
539
grid.export.png({
541
-
theme:"dark",
540
+
theme:"dark"// the exported theme, "light" by default
Copy file name to clipboardExpand all lines: docs/whatsnew.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Released on June X, 2025
40
40
41
41
- 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)
42
42
- 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:
44
44
-`tableName`- to set the name of a sheet with grid data in the Excel file
45
45
-`dateFormatMask` - to set the date format mask for Excel
46
46
- 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