Skip to Content
0

Fiori Application Printing

Feb 02 at 08:39 PM

256

avatar image

Hello:

I am creating an application on the SAP Cloud Platform and accessing all of the data through OData and SAPUI5. I need to be able to print a table (formatted with headers, and page numbers, etc.) at least to a PDF.

  • I've reviewed the other answers and blog posts and the approach seems to be either: 1) generate the document using ABAP on the back end (so not an option here); or 2) print using the browser (which does not provide neatly formatted output).

What is the best approach for formatted printing from SAPUI5/SCP? Should I incorporate Lumira or SAP Cloud Analytics into the solution? I have to imagine this is a fairly common problem...

Thanks in advance, Ian.

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

2 Answers

Best Answer
Ivan Mirisola
Feb 07 at 01:28 PM
1

Hi Ian,

AFAIK, there are no printing controls on SAPUI5. So SAPUI5 (Fiori included) do not carry any printing capability. You need to rely on other ways for printing. Reason being is that SAPUI5 is targeted at accomplishing a transacional task. Whereas printing is more related to reporting. You could use Forms by Adobe Service REST APIs that are available at SCP to send the data to a report template you create. Please check the use cases here. Basically, you need to create the template using Adobe LifeCycle Designer. Then send the template and data from the odata service to the REST API to generate the PDF. Once it is generated it will be displayed on the end-user's browser and ready for printing.

I understand that there are other Javascript libraries targeted at the creation of PDF files. But those will require more developing effort as they usually to do rely on a template.

Other then that, there is the SemanticPage component with PrintAction. But that only triggers a method on your controller that will deal with the printing. It is only a "cosmetic" button inside an actions menu based on the Fiori Design Guidelines.

One thing to keep in mind is that transacional applications will need often call the odata service again to retrieve the full set of records from a table instead of the displayed rows. So you will need to retrieve any filters, columns, etc that users have set and use those to perform an odata call before printing it.

I have seen customers implement this print functionality on a table using Smart Table component and downloading the data to an Excel CSV formatted file. Then printing would be done using the desktop features instead of the browser.

I think the PDF way is more "professional".

Regards,
Ivan

Share
10 |10000 characters needed characters left characters exceeded
Ian McCallum
Mar 08 at 07:47 PM
0

Thanks, Ivan. I have been exploring a number of other alternatives in the interim, including SAP Analytics Cloud, which is in keeping with your comment about the requirement being an analytics/reporting capability, and not really part of SAPUI5. Unfortunately, I have not been able to find a way to print (headers, page numbers, etc.) with SAP Analytics Cloud, either. Still think this is a fairly common requirement, and should be much more easily accomplished...maybe a future release!?

Share
10 |10000 characters needed characters left characters exceeded