jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Set header's charset when jqxGrid export to Excel
Tagged: angular grid, bootstrap grid, javascript grid, jquery grid, jqwidgets grid, jqxgrid, jqxGrid data export korean
This topic contains 2 replies, has 2 voices, and was last updated by soojung 8 years, 4 months ago.
-
Author
-
Hello,
I make jqxGrid and export data to excel.
With this code, I can make Korean data excel file .$btnExcel.click(function () { $jqxGrid.jqxGrid('exportdata', 'xls', '주문조회', true, null, false, null, 'utf-8'); });
But excel file name didn’t changed.
Korean file name looks break.How can I change file name’s charset?
Hi soojung,
the last parameter determines the charSet. In your case, you’ve set it to “utf-8”.
Here’s the documentation for the
exportdata
method:exportdata Method Exports all rows loaded within the Grid to Excel, XML, CSV, TSV, HTML or JSON. The first parameter of the export method determines the export's type - 'xls', 'xml', 'html', 'json', 'pdf', 'tsv' or 'csv'. The second parameter is the file's name. If you don't provide a file name, the Grid will export the data to a local variable. For example: var data = $("#jqxgrid").jqxGrid('exportdata', 'json'); The third parameter is optional and determines whether to export the column's header or not. Acceptable values are - true and false. By default, the exporter exports the columns header. The fourth parameter is optional and determines the array of rows to be exported. By default all rows are exported. Set null, if you want all rows to be exported. The fifth parameter is optional and determines whether to export hidden columns. Acceptable values are - true and false. By default, the exporter does not export the hidden columns. The sixth parameter is optional and determines the url of the export server. By default, the exporter is hosted on a jQWidgets server. The last parameter is optional and determines the char set. Parameter Type Description dataType String fileName(optional) String exportHeader Boolean rows Array exportHiddenColumns Boolean serverURL String charSet String Return Value None Code example Invoke the exportdata method. $("#jqxGrid").jqxGrid('exportdata', 'json', 'jqxGrid');
Best Regards,
ChristopherjQWidgets Team
http://www.jqwidgets.comHi Christopher,
Thank you for your response.Yes, I want to document charset to “utf-8”.
What is wrong in my code?
Could you give me sample code?I used ‘utf-8’ at the last parameter of jqxGrid ‘exportdata’.
Because I want to make file name in Korean.For example,
When I click ‘export excel’ button,
one alarm is appear at the down side of the browser. And say,“Do you want to open or save this ???.xls file of jqeurygrid.net?”
But I want to show that name ???(strange file name) —-> to right word.
-
AuthorPosts
You must be logged in to reply to this topic.