cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to convert entire sapui5 page into pdf

former_member607948
Discoverer
0 Kudos

Hi There,

I need to generate report in the client side based on certain filter criteria. I am using sap ui5 library with js view and standard page layout. My report page contains couple of tables, stacked bar chart, radial chart, viz frame and some texts. I tried using each of these or combination of these- jsPDF, html2pdf and html2canvas for converting to pdf. It did not generate entire page. If I convert one by one for tables and charts it converts to pdf and if I combine all of them, it creates multiple pages for each of the controls. I need to convert all in one pdf document. Is it even possible to convert entire page into single pdf, if yes could anyone please share the code.

Accepted Solutions (0)

Answers (3)

Answers (3)

DK007
Active Participant
0 Kudos

Hi,

Yes, you can use jsPDF javascript library to generate PDF on client side. This is not same as smart forms, but this has some formatting options available. Try below link for additional documentation.

https://raw.githack.com/MrRio/jsPDF/master/docs/

Thanks,

Dheeram

former_member607948
Discoverer
0 Kudos

Hi Vamsi,

Thank you for your answer. The problem is we don't use Odata service for back end. So we can't use form. Is there anyone who has done this in the past with proper formatting at the client side?

Regards,

Deepak

vamsixk
Active Participant
0 Kudos

a bit of a roundabout way to do this,

but when we generate a PDF, we use a back end service that generates a PDF based on an existing smart form which uses the data supplied by the UI5. or it could use the data that is already there in the back end.

so if you want a properly formatted PDF with fixed format, use a back end service that generates a smart form and then convert that to PDF.

Kind regards,

Vamsi

PS: if there is another way to create a PDF directly from SAPUI5 with proper formatting, i would like to know and will be following this thread for inputs.