export data from a grid to a csv file (excel)

Hello,

I have to export data from a grid to a csv file. So, the user clicks on a button which label is “exporter”. Then, the software should create a csv file and put the data into it. However, there is a problem ^^ i don t know how to make it (it is for a J2EE project). So, i come here to ask you some help ^^

Thanks you for everything :slight_smile: .

Vinou

grid supports

var csv = grid.serializeToCSV()

not you have grid as csv string, to send it to user you need to

  • send this csv string to the server ( not ajax, but form submit )
  • echo the same data from server side with correct headers.

Thank you ^^