Does anyone know when an export to Excel/CSV function is going to be built into JQGrid?
There are a handful of workarounds but we're looking for some simple functionality.
Does anyone know when an export to Excel/CSV function is going to be built into JQGrid?
There are a handful of workarounds but we're looking for some simple functionality.
I'm not affiliated with the jqGrid team, but I don't think there are any plans in the works to build the Excel export into the native jqGrid JavaScript library. You probably have to buy the php or ASP.NET libraries for that since the Excel generation requires server-side processing.
It wouldn't be too hard to write a JSON-to-CSV converter in JavaScript, but do you really want to ? Also, I can't really think of a way to serve a file to a user purely via JavaScript. This question appears to address that problem using js & Flash Generate some xml in javascript, prompt user to save it
Assuming you want to generate the Excel server-side, your best bet is to either buy the paid product, or write your own code to do it using the same datasource as the grid.
This is an old thread, but just in case anyone else hits this issue.
A few years ago, I wrote a C# class which let you export any DataSet
, DataTable
or List<>
to a "real" Excel file, using the OpenXML libraries, with one line of code.
I then documented a JavaScript library which would let you call this C# code from an Export button in your jqGrid:
Full details here:
The only gotcha is that your jqGrid
must have the loadonce
value set to true. If it isn't, my JavaScript code doesn't have access to the entire set of data which needs to be export to Excel.
Hope this helps.