Skip to Content
0

Download PDF from Fiori Launchpad ?

Mar 02, 2017 at 09:35 AM

88

avatar image

Hi Experts,

I created and application which has feature to download a complete report as a PDF File. I achieve this functionality by creating a smartform and send it to forntend using media streaming.

I deployed this application in HCP and on FLP as well. It is working as fine when I am executing that application from WebIDE or HCP. However, when I am executing the same application from Fiori Launchpad, it is giving error.

Error Screenshot:

:

var oPdfModel = new sap.ui.model.odata.ODataModel("<Path of oData Service>");
sap.ui.getCore().setModel(oPdfModel);

sPath = "/PDFSet(Id='" + Id + "')/$value";
oPdfModel.read(sPath, null, null, true, function(oData, oResponse) {
	var pdfURL = oResponse.requestUri;
	sap.m.MessageToast.show("Report is being downloaded.");
	html.setContent("<iframe id='idPdfFrame' src=" + pdfURL + " width='800' height='700' visible='false' ></iframe>");
	oPanel.addContent(html);
	oPanel.placeAt("idContentTab");
}, 
function(oError) {
	sap.m.MessageToast.show(oError.message);
});

Same id 'idContentTab' is used in index.html to place a component and referred here.

Could you please suggest anything to solve this issue..

Thanks in Advance

-Ketan

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers