Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting ng-grid data to CSV and PDF format in angularjs

Please Help me....any plugin is there..?

I have searched for exporing excel and PDF in angularjs. using ng-grid.

Exporting ng-grid data to CSV and PDF format in angularjs

like image 834
Rajesh kumar Avatar asked Sep 19 '13 12:09

Rajesh kumar


2 Answers

For csv export there is the ngGridCsvExportPlugin that you can find here
Just at a reference to the script and add the ngGridCsvExportPlugin to the gridOptions
(and activate the footer too by adding showFooter : true to the gridOption)

 $scope.gridOptions = {
        data: 'myData',
        plugins: [new ngGridCsvExportPlugin()],
        showFooter: true,
      };

A basic plunker where you can see it at work can be found here

like image 96
AardVark71 Avatar answered Oct 03 '22 14:10

AardVark71


You don't need any external plugin now. ng grid which new version is called now UI-Grid has native support. Method names are csvExport and pdfExport.

http://ui-grid.info/docs/#/tutorial/206_exporting_data

like image 42
Rajul Avatar answered Oct 03 '22 16:10

Rajul