Skip to Content
0
Former Member
May 28, 2014 at 09:23 PM

Problem in Export PDF from SAP UI5 on XSEngine Data

102 Views

Hi,

I have created the SAP UI 5 which is pulling the data from XSEngine. I have done 'Export To Excel' from SAP UI to export the data which is loading from XSEngine Service. I have been trying to 'Export To PDF' like the way I did for 'Export To Excel', it is not working. I am getting the below when It is opened as a PDF.

Export To Excel - SAP UI 5 code - This is working fine

function createDownloadLink(b64text) { var oLink = new sap.ui.commons.Link("linkExportCsv", { text: 'Export To Excel', href: 'data:application/csv;charset=utf-8;base64,' + (Base64.encode(b64text)) }); initDownloadAttr('FileName-Example.csv'); return oLink;

}

Export To PDF: This is not working

function createDownloadLinkPdf(b64text) {

var oLink = new sap.ui.commons.Link("linkExportPdf", {

text: 'Export To Pdf',

href: 'data:application/pdf;base64,' + (Base64.encode(b64text))

});

initDownloadAttrPdf('FileName-Example.pdf');

return oLink;

}

Attachments

SAPUI5Grid.png (124.9 kB)
pastedImage_0.png (187.3 kB)