Skip to Content
0
Oct 22, 2020 at 10:18 PM

No additional worksheet with metadata is added in sap.ui.export.SpreadSheet

130 Views

I am following exactly the code found here in the API Reference for sap.ui.export.SpreadSheet. No error is occurring, but I cannot generate the second Worksheet in the Excel file that contains the Meta Data info. The Excel file gets generated but there is no metadata tab. Does this functionality work for anyone else? What am I doing wrong? See the code below:

jQuery.sap.require("sap.ui.export.SpreadSheet"); var mDataSource = [{name: "Devin", salary: "50"}]; var aColumns = []; aColumns.push({ label: "Name", property: "name" }); aColumns.push({ label: "Salary", property: "salary", type: "number", scale: 2 }); var mSettings = { workbook: { columns: aColumns, context: { application: 'Debug Test Application', version: '1.82.1', title: 'Some random title', modifiedBy: 'John Doe', metaSheetName: 'Custom metadata', metainfo: [{ name: 'Grouped Properties', items: [{ key: 'administrator', value: 'Foo Bar' }, { key: 'user', value: 'John Doe' }, { key: 'server', value: 'server.domain.local' }] }, { name: 'Another Group', items: [{ key: 'property', value: 'value' }, { key: 'some', value: 'text' }, { key: 'fu', value: 'bar' }] }] }, hierarchyLevel: 'level' }, dataSource: mDataSource, fileName: "salary.xlsx", count: 1 }; var oSpreadsheet = new sap.ui.export.SpreadSheet(mSettings); oSpreadsheet.attachBeforeExport = function(oEvent){ var event = oEvent; }; oSpreadsheet.build();