I want to export grid data to excel or csv… I found the following steps in the support:

Client side code generates CVS text

b) CSV text send to server

c) Server send data back to clietn with proper headers

But can you please tell me with example how to handle it in the server side.

Thanks in advance


Which server side language you are using? ( If necessary - I can provide a PHP based sample )

Basically on client side you will have

function exportCSV(){
document.forms[0].csv.value = mygrid.serializeToCSV();

on server side

header(“text/csv”); // in case of Win based users , you can send ms-excell header, so file will be opened by Excel
echo $_POST[‘csv’]; //send data back to client side, because of header, it will be treated as file