Somebody knows a way to export the data from a jqgrid to excel?
I want to do a report using this jqgrid that i think is awsome. But i need to save or print this report somehow, because is information to be keeped. Somebody knows any way??
Somebody knows a way to export the data from a jqgrid to excel?
I want to do a report using this jqgrid that i think is awsome. But i need to save or print this report somehow, because is information to be keeped. Somebody knows any way??
Great function!
I have made changes.
I solved your problem .and now iam able to export data excel with column names please refer my code.
Please let me know if you face any problem.
very good question, i was scratching my head off about this as well. I made it by choosing Felix's suggestion, let me complete it by adding following lines to your html body.
The only problem i have is the excel file exported doesnt include my column names in jqgrid, also is there a way to exclude a particular or several columns when exporting to excel file?
thank you ~
This is my approach, just add this code to your js/html file
PHP script
create a form and a hidden element with the name "csvBuffer". This element gets set by the function. I had to change the line
to
in order to escape it properly.
Here is a clever solution to save the
jqGrid
data as excel sheet without calling thephp
script: (You just need to call this function withGridID
and an optionalFilename
)We first create a
CSV
string delimited with;
. Then ananchor
tag is created with certain attributes. Finallyclick
is called ona
to download the file.You could have a look at several excel MIME Types : MIME Type List