cancel
Showing results for 
Search instead for 
Did you mean: 

PDF printing in SAP UI5

Former Member

Hi,

I have made a table in sap ui5 which retrieves some data.I want to get this data in PDF rather than screenshot.as screenshot will cover only screen visible at a time.What to do in this case?

Accepted Solutions (1)

Accepted Solutions (1)

santhu_gowdaz
Active Contributor
0 Kudos

Generating PDF from the backend is the good approach. But if you want it from Client Side, here is the example,

Export to Pdf from UI5 side,

http://jsfiddle.net/54muk2ps/

Former Member
0 Kudos

its not working..

Private_Member_15166
Active Contributor
0 Kudos

Yes this is not working because in External Resources https://rawgit.com/someatoms/jsPDF-AutoTable/master/examples/jspdf.debug.js this is not found.

Go through this blog.

This is same.

santhu_gowdaz
Active Contributor
0 Kudos
Private_Member_15166
Active Contributor
0 Kudos

Check this out. Same code with updated JS file.

JSPDF - JSFiddle

Former Member
0 Kudos

Could ypou please tell what are p and pt in jspdf.I have tried running same but showing error at this line

Private_Member_15166
Active Contributor
0 Kudos

Parameters:

orientation:- One of "portrait" or "landscape" (or shortcuts "p" (Default), "l")


unit:- Measurement unit to be used when coordinates are specified. One of "pt" (points), "mm" (Default), "cm", "in"


format:- One of 'a3', 'a4' (Default),'a5' ,'letter' ,'legal'

Former Member
0 Kudos

Ok thanks.One more thing I have included

1)jspdf.debug.js

2)jspdf.plugin.autotable.js

still its not working.Do I need to download something

Former Member
0 Kudos

ok thanks.One more thing.I have added two plugins in script

1)jspdf.debug.js

2)jspdf.plugin.autotable.js

Still not getting pdf.What can be the problem.Should I download something

Private_Member_15166
Active Contributor
0 Kudos

Is there any error you are getting in your console??

No. This is enough.

Tell me your error, if any at browser's console?

Former Member
0 Kudos

I have done it.Thanks.I got another problem.Data is not cuming in pdf as the data that I am capturing in my table is from XML.so in dataarray.push document there must be something else than aData whinch I am not able to understand

Private_Member_15166
Active Contributor
0 Kudos

Data is not cuming in pdf as the data that I am capturing in my table is from XML.

What do you mean?

Private_Member_15166
Active Contributor
0 Kudos

At this point,

dataArray.push(aData[filteredIndices[index]]);

Basically content of aData is being pushed to an Array with name dataArray with index starting from 0.

Check out this simple example.

JSPDF - JSFiddle

Former Member
0 Kudos

but mydata is not in aData form.It is in XML  form.what to do in that case

Private_Member_15166
Active Contributor
0 Kudos

How your's XML from looks like??

Former Member
0 Kudos

In the front end it displays in a table but when we capture from backend database,it is in xml form.

Private_Member_15166
Active Contributor
0 Kudos

Your oData will be in XML format, but what is the issues in it? You have to use same procedure.

Are you getting any error in your browser's console?

Answers (2)

Answers (2)

Former Member
0 Kudos

yes the functions are not applied .It is showing error.Becoz I have captured the XML value in

DomTest variabale which I tried tro add in place of aData but its not working

Private_Member_15166
Active Contributor
0 Kudos

Hi,

Follow this blog.

or generate the PDF at back end only.