jqgrid 导出到 Excel 路线图?

发布于 2024-12-06 13:44:38 字数 74 浏览 1 评论 0原文

有谁知道 JQGrid 何时会内置导出到 Excel/CSV 的功能?

有一些解决方法,但我们正在寻找一些简单的功能。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一刻暧昧 2024-12-13 13:44:38

请参阅jqgrid 是否支持“开箱即用”导出到 excel 还是我需要编写一些服务器端代码?

我不隶属于 jqGrid 团队,但我不认为有任何计划将 Excel 导出构建到本机 jqGrid JavaScript 库中。您可能必须为此购买 php 或 ASP.NET 库,因为 Excel 生成需要服务器端处理。

用 JavaScript 编写一个 JSON 到 CSV 的转换器并不太难,但你真的想这样做吗?另外,我真的想不出一种纯粹通过 JavaScript 向用户提供文件的方法。这个问题似乎使用 js & 解决了这个问题。 Flash 在 javascript 中生成一些 xml,提示用户保存它假设

您想要生成 Excel 服务器端,您最好的选择是购买付费产品,或者使用与网格相同的数据源编写自己的代码来完成此操作。

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.

完美的未来在梦里 2024-12-13 13:44:38

这是一个旧线程,但以防万一其他人遇到这个问题。

几年前,我编写了一个 C# 类,可让您将任何 DataSetDataTableList 导出到“真正的”Excel文件,使用 OpenXML 库,通过一行代码。

C# ExportToExcel 库

然后我记录了一个 JavaScript 库,它可以让您从以下位置调用此 C# 代码jqGrid 中的“导出”按钮:

Export

此处的完整详细信息:

从 jqGrid 导出到 Excel

唯一的问题是您的 jqGrid 必须将 loadonce 值设置为 true。如果不是,我的 JavaScript 代码将无法访问需要导出到 Excel 的整个数据集。

希望这有帮助。

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:

Export

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文