0

I have code that exports the table data to Excel, however it is only exporting the current page, and not all pages.

This post contains my solution that I am using for exporting the data.

The code is correctly only showing the filtered results if a filter is being used, however I cannot determine how to export the data from all pages rather than just up to the value of rowNum.

Can somebody please help?

Community
  • 1
  • 1
MarkT
  • 81
  • 7
  • Why you submit the data from the client (jqGrid) to the server? You loaded the data already from the server before? Is it not easier to provide the new web method on the server, which returns XLSX file **directly** instead of JSON data? One don't need any export from jqGrid to XML if one follows the approach. – Oleg Dec 12 '16 at 21:23
  • @Oleg - Do you have a demo of exporting this way that I could use? – MarkT Dec 12 '16 at 21:39
  • I use ASP.NET MVC and OpenXML SDK, which code in opened (see [here](https://github.com/OfficeDev/Open-XML-SDK)). As the result one can generate clean XLSX file on the server side. [The answer](http://stackoverflow.com/a/13957161/315935) and [another old one](http://stackoverflow.com/a/9349688/315935) provide the corresponding demo code ([here](http://www.ok-soft-gmbh.com/jqGrid/ExportToExcel.zip) for example). I'm not sure that the code can help you. – Oleg Dec 12 '16 at 21:45
  • @Oleg - Thanks Oleg. Unfortunately, I cannot use your ASP.NET code. Using the code from my [other solution](http://stackoverflow.com/questions/41051490/jqgrid-export-to-excel-with-php-server/41109209#41109209) can you think of a way to change what exported to include all pages of data? – MarkT Dec 12 '16 at 22:19
  • You are welcome! You need just use `getGridParam("data")` instead of `getDataIDs` and `getRowData`. If you need to get additionally all ids then you should use `getGridParam("_index")` too. See [the old answer](http://stackoverflow.com/a/9145342/315935) or [this one](http://stackoverflow.com/a/12373813/315935). – Oleg Dec 12 '16 at 22:56

0 Answers0