0

I have developed an ASP.NET MVC 4 web application which uses JQgrid to generate tables.

I also need to Export my Grid data to an Excel File.Is it possible in Jqgrid. I searched in 'trirand' and i cant see any jQgrid demo to export grid data.

Should i use any library to Export data to Excel or is there any feature available in Jqgrid to Export data.

Any help is appreciated.

Script

$("#Grid").jqGrid('navButtonAdd', '#Pager', {
                caption: "Export to Excel",
                buttonicon:"ui-icon-save", 
                onClickButton: function () {
                    var gridData = $("#Grid").jqGrid('getRowData');
                    var dataToSend = JSON.stringify(gridData);
                    jQuery("#Grid").jqGrid('excelExport', dataToSend);
                }
            });

Here i am trying to Export Json Data to Excel Format. But i am getting some error in grid.import.js file.

Uncaught TypeError: Cannot call method 'indexOf' of null ---  grid.import.js:208 
Cyber
  • 4,844
  • 8
  • 41
  • 61
  • Look at [the answer](http://stackoverflow.com/a/9349688/315935). [Another answer](http://stackoverflow.com/a/13957161/315935) shows how the visibility of the exported data can be improved. – Oleg Feb 03 '14 at 10:56
  • Thanks for the information @Oleg . I tried in different way ,because i want to do all the (Excel Export) processing to be done from Client Side itself to reduce Server Load. Please see my updated post. – Cyber Feb 04 '14 at 06:42

0 Answers0