ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

UI-Grid multiple grid PDF export

Open samitpurkait opened this issue 11 years ago • 12 comments

I have two controllers with one grid each. When I try to do the following: $scope.export = function(){ console.log("$scope.export"); $scope.gridApi.exporter.pdfExport(uiGridExporterConstants.ALL); };

it only exports the first grid. How can I export both grids in one PDF. Been fiddling with it a lot, cant find the right answers. Help will be appreciated.

samitpurkait avatar Jun 19 '15 18:06 samitpurkait

You need to export from each grid independently. The gridApi that you export from will be the grid that is exported - you need to get a separate gridApi from each gridOptions.

PaulL1 avatar Jun 19 '15 19:06 PaulL1

Right now I am calling it like this div ng-controller="MainCtrl"> button ng-click="export()">PDF Export</button

in the html page. I just want a single export btn to export both grid in one pdf.

eg. ng-controller="MainCtrl" ng-Controller="SecondCtrl"

samitpurkait avatar Jun 19 '15 20:06 samitpurkait

I think this is more of a js question than a grid question. Essentially you'll need to call export separately on each grid. If the gridApi is in different controllers, then you'll need to write a service or something else to make the export button able to call cross-controller. Do they need to be in separate controllers,? It'd be easier if they weren't.

PaulL1 avatar Jun 19 '15 22:06 PaulL1

I am new to Angular JS or even JS. I tried setting the data in one controller with two $scope, but when I run the export function only the bottom $scope is displayed in PDF.

$scope.gridApi.exporter.pdfExport(uiGridExporterConstants.ALL);

Using this as an export parameter. Here is the plunker: http://plnkr.co/edit/MOzqyVGf2lBqc9LUazXu?p=preview

samitpurkait avatar Jun 21 '15 17:06 samitpurkait

This is a useful request, but not really in the current roadmap. We have far too many good ideas in the repository already, giving the impression that we have a project riven with defects.

Accordingly, I am leaving the enhancement tag on this, but closing it. If someone would like this functionality, we'd welcome a pull request that adds it.

PaulL1 avatar Nov 18 '15 07:11 PaulL1

@proNueb Hey ,I have the same requirement as yours that is exporting multiple UI grid data within a controller to a single pdf. Were you able to come up with the solution?

shwetaku avatar Nov 18 '16 09:11 shwetaku

We started using kendo grid. And they have functional excel and PDF export.

Thank you,

On Nov 18, 2016 3:37 AM, "shwetaku" [email protected] wrote:

@proNueb Hey ,I have the same requirement as yours that is exporting multiple UI grid data within a controller to a single pdf. Were you able to come up with the solution?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

samitpurkait avatar Nov 18 '16 13:11 samitpurkait

us too, any solution ?

Hammerst avatar Dec 08 '16 15:12 Hammerst

Hey,I have the same requirement to export multiple UI grids data to single pdf/csv. Were you able to come up with a solution?

kiranthadathil avatar Dec 28 '16 19:12 kiranthadathil

PRs are welcome!

dlgski avatar Dec 29 '16 13:12 dlgski

I have the same need: exporting multiple grids data to single csv. Anyone figured out a solutions? Thanks in advance.

aquadawn avatar Jul 28 '17 17:07 aquadawn

Please include this feature, I need to export multiple grids as different sheets in single csv file. Anyone tried like this ??

venkat-subramani avatar Jan 11 '18 10:01 venkat-subramani