views:

462

answers:

1

I use only js (php backend) to create jqGrid. I want to add print/export to excel with js, not to include all the php classes for jqGrid (jqGrid.php) and duplicate code. Is it possible and how?

A: 

There are no perfect way to print a jqGrid. Some information which can help you you can find in http://stackoverflow.com/questions/2962142/print-webpages-problems-looking-for-good-tutorial-to-print-web-pages-build-by/2962569#2962569.

The best results with exporting the information in Excel you can reach with respect of Open XML SDK 2.0 used on the server (see more links under http://stackoverflow.com/questions/2682208/how-to-export-asp-net-mvc-detail-view-data-to-an-excel-file/2682324#2682324 and http://stackoverflow.com/questions/2595489/strategy-in-exporting-to-excel-with-formatting-from-asp-net/2917139#2917139). I am not sure, that you can do this in your environment.

You can try also to use excelExport method of jqGrid implemented in grid.import.js.

Oleg