I have used exporter plugin the datagrid and have got the grid data in CSV format.
But I want to make this data to be downloadable in excel format. One solution is that I can send an ajax request to server and send back the excel.
Just wanted to know if there is a way by which this excel can be created and downloaded without hitting server.
My export code as of now is:
function exportAll(){
dijit.byId("grid").exportGrid("csv", function(str){
alert('Data to be exported',str);
});
};
See
Exporting a dojo datagrid to a csv file
You cannot open excel via javascript so it needs to be a GET download request.
Send the
strto server withxhrPost, put into temp-file there, print the temp-url and in thexhrPostsuccess callback function, callwindow.open("./" + responseText, "_new");. Its also possible to use theio.iframetransport one of the answers in that post shows.