Exporting Jqgrid into excel is not working in jsp

Hello Guys!! I have a jqgrid which displays the records .Now as per my requirement i have to export it into excel format .i am trying to do it but its not happening any how.Export to excel button is not working.Here i am posting my code… type=”text/javascript” src=”calender.js”> $(document).ready(function() //var windowWidth = (document.documentElement….

via Word Tutorials » Search Results » ajax:

Exporting Jqgrid into excel is not working in jsp

Hello Guys!! I have a jqgrid which displays the records .Now as per my requirement i have to export it into excel format .i am trying to do it but its not happening any how.Export to excel button is not working.Here i am posting my code…


Logo








………………………………………..

I see some design problems in your solution. I will just try to describe what you do:
You have data saved on the server. Probably you save the data in the database.
You fill jqGrid with the data returned from the server per Ajax request.
If the user click on “Export to Excel” button you try to read the data from the cells of the current page of the grid and send the data to the server per HTTP POST. You expect that server (csvExport.jsp) will generate some Excel file and returns the data back to the client.
Could you explain me why you need to send the data from the jqGrid to the server? The server has already all the data and exactly the server get the data already for you. Is it not easier just to send request to the server only with the parameters of the grid ($(‘#todate’).val() and $(‘#fromdate’).val()) and the server will get all the data directly from the database?
By the way you have in your code typing error: var fromdate=$(‘#todate’).val();. You mean probably var fromdate=$(‘#fromdate’).val()?
About the implementation of server side code see here. I am not sure whether it will help you, but in another answer I posted before the code which shows how to use Open XML SDK 2.0 to generate real Excel files (.XLSX files) in the server code.

For more info: Exporting Jqgrid into excel is not working in jsp

Word Tutorials » Search Results » ajax

Exporting Jqgrid into excel is not working in jsp

Share this post:

Related Posts

Leave a Comment