Skip to Content

SAPUI5 Print PDF

Hello Experts,

I am trying to do the print functionality in sapui5 through OData Service.

My service is giving the result , but in my screen its showing only Loading for a long time and not displaying anything.

Please check the below code and help me out.

var oButton = new sap.ui.commons.Button({

id : 'B-Create',

text : 'Display PDF',

width : '10em',

press : function(){

var sRead = "/zpdfset('" + oTF.getValue() + "')" + "/$value" ;

oModel.read( sRead, null, null, true, function(oData, oResponse){

var pdfURL = oResponse.requestUri;

html.setContent("<iframe src=" + pdfURL + " width='700' height='700'></iframe>");

oPanel.addContent(html);

oPanel.placeAt("content");

},function(){

alert("Read failed");});

}

});

Regards,

Vikash

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Aug 25, 2015 at 09:35 AM

    see this thread-PDF printing in SAP UI5

    check out this example

    JSPDF - JSFiddle

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.