jQWidgets Forums
jQuery UI Widgets › Forums › Grid › export to xls
Tagged: grid exporting
This topic contains 4 replies, has 2 voices, and was last updated by rubenfernande3 10 years, 4 months ago.
-
Authorexport to xls Posts
-
hi, i´m having some problems when i try to export a grid to a xls file.
I doesn´t work when the content of data has special characters like ‘ñ’ or ‘´’ (tipical spanish characters). If i save the generated file in utf-8 format and i try to open again the file with oficce it works.I imagine that i have to generate the data into utf-8 format. After looking the API, i have seen something related with the charset but im not sure if i’m using this feature correctly.
The code that i use for this purpose is this (it doesnt work for me, it generates the file but when i try to open excel gives me an error):
Excel.click(function () {
exportinfo = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xls’, null, true, null, null, null, ‘utf-8’);});
Hi rubenfernande3,
As far as I see you’ve set the chart set parameter so we do not know what could be the issue with the exported data. Excel logs the errors so you may try to debug that using the Error Log. I also suggest you to see whether the “type” of your datafields is set to the appropriate data type.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comthanks peter i will work on it.
i´ve found the problem.
It works without setting the heads to true.Excel.click(function () {
exportinfo = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xls’, null, false, null, null, null, ‘utf-8′);});
So the problem is with the heads because the rest of the data has special spanish characters to and works perfectly.
This is the code i use for defining the columns. The problem comes with ‘Año’ and ‘Autorización’. If i change both with ‘Ano’ and ‘Autorizacion’ it works. Any idea?
columns: [
{ text: ‘Año’, dataField: ‘año’, width: ‘5%’ },
{ text: ‘Num.’, dataField: ‘NumeroRegistro’, width: ‘5%’ },
{ text: ‘Servicio’, dataField: ‘Servicio’, width: ‘15%’, filtertype: ‘date’, columntype: ‘datetimeinput’ },
{ text: ‘Nombre de proyecto/producto’, dataField: ‘NombreProducto’, width: ‘25%’ },
{ text: ‘Proveedor’, dataField: ‘Proveedores’, width: ‘11%’ },
{ text: ‘F. Solicitud’, dataField: ‘FechaSolicitud’, filtertype: ‘date’, cellsformat: ‘dd/MM/yyyy’, width: ‘11%’ },
{ text: ‘F. Autorización’, dataField: ‘FechaDecision’, filtertype: ‘date’, cellsformat: ‘dd/MM/yyyy’, width: ‘10%’, columntype: ‘datetimeinput’ },
{ text: ‘Imp. Autorizado’, dataField: ‘ImporteTotalAutorizado’, width: ‘11%’, cellsformat: ‘c’ },
{ text: ‘Estado’, dataField: ‘Estado’, cellsrenderer: imagerenderer, width: ‘7%’ }
]});
in firefox works perfectly. The problem comes in my old ie8.
-
AuthorPosts
You must be logged in to reply to this topic.