cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Excel file download using sap.ui.export.Spreadsheet

veeraa83
Explorer
0 Kudos
1,138

Hi,

I need to download the contents of sap.ui.table into an excel file(.xlsx). I followed the below code in the sample demo.

https://sapui5.hana.ondemand.com/#/entity/sap.ui.export.Spreadsheet/sample/sap.ui.export.sample.json...

I get a warning message as below.

When I click on the export button, I see the following error in the message toast.

Complete text of the above error: Please let me know if I am missing anything.

The following error has occurred during export: Unexpected server response: /** * Spreadsheet Worker - Document Export Services */ var spreadsheet; var request; var origin = self.origin || ""; // Load libraries importScripts(origin + 'libs/uri.all.min.js'); importScripts(origin + 'XLSXBuilder.js'); importScripts(origin + 'XLSXExportUtils.js'); importScripts(origin + 'libs/JSZip3.js'); // Promise implementation for IE if (!self.Promise) { importScripts(origin + 'libs/es6-promise.js'); ES6Promise.polyfill(); } onmessage = function(e) { if (e.data.cancel) { if (request) { request.cancel(); } close(); return; } cancelled = false; var mSettings = e.data; spreadsheet = new XLSXBuilder(mSettings.workbook.columns, mSettings.workbook.context, mSettings.workbook.hierarchyLevel, mSettings.customconfig); request = XLSXExportUtils.oData.fetch(mSettings, processCallback); }; function processCallback(oMessage) { if (oMessage.rows) { spreadsheet.append(oMessage.rows); } if (oMessage.error) { postMessage({ error: oMessage.error }); close(); } if (oMessage.progress) { postMessage({ status: oMessage.progress }); // Send status update } oMessage.finished && spreadsheet.build().then(saveSpreadsheet); } function saveSpreadsheet(arraybuffer) { postMessage(arraybuffer, [arraybuffer]); close(); // Terminate the Worker }

In the console it gives the following error.

Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'mEventRegistry')

at b.destroy (EventProvider-dbg.js:368:23)

at d.destroy (Spreadsheet.js:7:605)

at <anonymous>

Regards

Veera

junwu
Active Contributor

your environment& code, please

Accepted Solutions (0)

Answers (0)