开发者

jqgrid Export to Excel roadmap?

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.


see Does jqgrid support exporting to excel " out of the box" or do i need to write some server side code?

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.

C# ExportToExcel library

I then documented a JavaScript library which would let you call this C# code from an Export button in your jqGrid:

jqgrid Export to Excel roadmap?

Full details here:

Export to Excel from jqGrid

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜