Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid:Export to Excel stopped working #6774

Closed
paradizex opened this issue Jun 25, 2018 · 3 comments
Closed

Grid:Export to Excel stopped working #6774

paradizex opened this issue Jun 25, 2018 · 3 comments

Comments

@paradizex
Copy link

paradizex commented Jun 25, 2018

I was trying to Export my grid data to Excel after Deploying throught my Jenkins CI today and it wouldn't export. On further investigation I found that even the sample grid on UI-Grid's wesite is throwing the same error

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

TypeError: docDefinition is null
Stack trace:
formatAsExcel@http://ui-grid.info/release/ui-grid.js:20694:17
excelExport/<@http://ui-grid.info/release/ui-grid.js:20809:32
processQueue@http://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular.js:17374:37
scheduleProcessQueue/<@http://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular.js:17422:27
$digest@http://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular.js:18535:15
$apply@http://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular.js:18923:13
ngEventHandler/<@http://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular.js:28069:17
defaultHandlerWrapper@http://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular.js:3780:3
eventHandler@http://ajax.googleapis.com/ajax/libs/angularjs/1.7.0/angular.js:3768:9

I have tried to use both Chrome & Firefox, but Excel Export does not work.

Edit 1: screenshot

image

Edit 2: The last version it works for me is on bower v4.4.7

sujeetpillai added a commit to sujeetpillai/ui-grid that referenced this issue Jun 29, 2018
The default exporterExcelCustomFormatter custom function currently returns null which causes errors downstream. It should return the unmodified docDefinition

This should fix issue angular-ui#6774
@nicogaspa
Copy link

The problem is in:
gridOptions.exporterExcelHeader = gridOptions.exporterExcelHeader ? gridOptions.exporterExcelHeader : function( grid, workbook, sheet, docDefinition ) { return null; };
Either the function should not return null, or if the option is false, it should return false

@sujeetpillai
Copy link
Contributor

I found the issue in exporterExcelCustomFormatter. That was causing the error for me. I fixed the wrong function the first time. I've sent an additional commit to the pull request.

defields923 pushed a commit to defields923/ui-grid that referenced this issue Oct 30, 2018
…dified docDefinition

* Default exporterExcelCustomFormatter shouldn't return null

The default exporterExcelCustomFormatter custom function currently returns null which causes errors downstream. It should return the unmodified docDefinition

This should fix issue angular-ui#6774

* Correcting the fix

The fix is supposed to be for exporterExcelCustomFormatter not exporterExcelHeader

closes angular-ui#6774
@Kirti-Chandra-Shahi
Copy link

UI-grid export feature is Not working on a deployment. But for a different server with older deployment it works fine. We aren't getting any error.
We copied the published folder from older deployment & deployed it in our test server. But it didn't resolve the issue. Everything else works fine, but not the export feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants