jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Export to excel?
Tagged: Exportdata
This topic contains 6 replies, has 2 voices, and was last updated by jose Ivan 12 years, 6 months ago.
-
AuthorExport to excel? Posts
-
Hi , I really don’t understand how export data works. Do i have to configure something in exportdata.js or exportgridata.js ? something about server host ? because i got a error and I work with aspx and my server it’s IIS.
it’s simple but i don’t know why it doesn’t works .
$("#jqxgrid").jqxGrid('exportdata', 'xls', 'jqxgrid');
if I export to xls or html i get this error
TypeError: Cannot call method ‘toString’ of undefined
- arguments: Array[2]
- get message: function () { [native code] }
- get stack: function () { [native code] }
- set message: function () { [native code] }
- set stack: function () { [native code] }
- type: “non_object_property_call”
- __proto__: Error
Hi jose Ivan,
The provided information is not enough for reproducing the reported behavior. If you wish us to test your scenario, please send us a sample to support@jqwidgets.com which demonstrates it. Modification of any file coming with the non-commercial license is prohibited. Please, read the EULA for details.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThanks for reply , when i said “Do i have to configure something ” I mean if I have to change any property because i was reading the documentation and I see this “The last parameter is optional and determines the url of the export server. By default, the exporter is hosted on the jQWidgets website.”
My projects it’s on ASP.net and it’s kind difficult send u.!!!
Hi , I was trying to find the error when i trying to export.
In your example “Export data” you don’t have a checkbox column and works fine but if you add a checkbox column it gives me error.
I added to your example checkbox column and works fine ! but in my doesn’t work.
I got a question I added a Column type checkbox but this column doesn’t exist in my dataarray , so when grid has bindinComplete I search this column and i set the value to false. When I try to export when try to searh the column type doesn’t find so it return string.
To export Do i have to add this column to my object datasource ?
Which it is best way to bind the grid?
In your example got this .
var data = generatedata(100); var source = { localdata: data, datatype: "array", updaterow: function (rowid, rowdata) { // synchronize with the server - send update command } }; var dataAdapter = new $.jqx.dataAdapter(source);
In my example i got this =>
var respuesta = $.parseJSON(result.d); var source = { datatype: "json", datafields: [ { name: 'ready', type: 'boolean' }, { name: 'isclient', type: 'boolean' }, { name: 'indice', type: 'int' } ], id: methods.getID()//return my ID }; $.map(respuesta.result, function (n, i) { n.ready = 0; // I set the values of columns that not in my array so I add. n.isclient = 0; n.indice = i + 1; }); source.localdata = respuesta.result; var cantidad = respuesta._datas.length;// I add the other datafields.... this come the server and i don't know the names. for (var i = 0; i < cantidad; i++) { source.datafields.push({ name: respuesta._datas[i].datafields }); } var dataAdapter = new $.jqx.dataAdapter(source); $('#name').jqxGrid({ source: dataAdapter });
WHen i Try to export the first column type boolean it gives me error
var u = function (E, B, C, A, G, F, D) {
this is because “this.element” is undefined. In your example comes pretty well.
var t = a(this.element);
u(r, t, true, false, this, s, v);
-
AuthorPosts
You must be logged in to reply to this topic.