6

I use Fixed Data Grid in my project.

https://facebook.github.io/fixed-data-table/example-sort.html

I want to take csv and pdf reports. Is it possible to export grid data to pdf or csv directly? Or what can I do to take csv and pdf reports with data provider(JSON Array) of datagrid?

javauser35
  • 925
  • 2
  • 8
  • 22
  • I haven't been able to find any built in csv export option in this module but for the CSV export I just built my own very quickly. You already have the data that you're providing to the component, all you have to do is write a function that organizes the data into csv format. Put a button on the table and onClick invoke the function. For building the csv exporting here is a guide: http://stackoverflow.com/questions/14964035/how-to-export-javascript-array-info-to-csv-on-client-side – Ali Apr 21 '17 at 19:50

1 Answers1

1

Since you have access to the raw JSON data that gets displayed within the table, you should be able to use a library like Papa Parse to "unparse" the data into a csv format, which can then be downloaded.

As for converting to pdf, I would look into the jsPDF library. See this answer for details about how to do that.

Community
  • 1
  • 1
wesleysmyth
  • 3,478
  • 2
  • 14
  • 15