cancel
Showing results for 
Search instead for 
Did you mean: 

Print Forms in SAP UI5

rahul_mb
Active Participant
0 Kudos

Hi Experts,

I was creating some sample Apps in UI5 and was wondering whether we can include print forms with this. In SAP GUI we can use SAPscript/Smartform/Adobe Forms and in WDA we use Adobe Forms. Similarly is there any way to implement print forms with UI5.

Regards,

Rahul Muraleedharan.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi Rahul,

I have also the same requirement. Have you got any solution or concept to do the same.

Please update here.

Regards,

Bhavesh

shabir_ismail
Participant
0 Kudos

Hello Bhavesh,

The way i implemented my solution is to call the adobe form without viewing it.

You will get the form in one of the returning parameters as raw string.

You need to convert the Raw string into Xstring.

Then create a MIME object from that Xstring.

Embed the MIME file in you UI5 application.

Pavan24
Discoverer
0 Kudos

Can you tell me solution, if you have solved print.

Answers (5)

Answers (5)

agentry_src
Active Contributor
0 Kudos

This thread is now locked against Necromancy and Hijacking.  Please create your own Discussion marked as a Question instead of resurrecting the dead or hijacking someone else's thread.

Regards, Mike (Moderator)

SAP Technology RIG

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Rahul,

I dont't know Adobe Forms etc., but if you simply want to print a HTML-Form, you can include a custom css style sheet which will be used if the form is printed via the browser.

Include it this way:

<link rel="stylesheet" type="text/css" href="print.css" media="print" />

In this stylesheet you could set all elements invisible except the form elements, and give the form a style that fit your needs.

To print the page you can use this simple javascript:

window.print()

Hope this helps

Greets,

Ben

rahul_mb
Active Participant
0 Kudos

Hi Ben,

Thanks for the info! I suppose the print that you are referring to, is the usual print that is available in web pages, which will print the currently displayed page as it is. My requirement is quite different.

Consider a scenario in which I have created small webshop using UI5. Now the customers log in to this webapp and buys different products. When his shopping is completed, the system will generate the invoice (with all the details of the items purchased, customer address, item price, quantity, net price, ship to address) of the purchase as a PDF and if needed he can print/download it. It will be really great if you could throw some light on this.

Regards,

Rahul Muraleedharan.

Former Member
0 Kudos

Hey Rahul,

thx for clarification.

I think what you need is a javascript pdf library like jsPDF (http://parall.ax/products/jspdf).

You can use such a library on serverside (in an xsjs) to generate the invoice-PDF and save it to a database-table.

Next step would be to offer the a download-link to the document.

Alternatively you could send the document directly to the browser, but maybe It's a good Idea to archieve the invoices

I've not done this before, but I'm pretty sure that it's possible this way. (At least I've used a 3rd party zip-library to create zip-files on serverside and send them to the browser - without big problems...)

Greets,

Ben

rahul_mb
Active Participant
0 Kudos

Hi Ben,

I was not actually looking for a JavaScript PDF library. Instead I am on the search of a solution put forward as a standard practice by SAP, since these kind of requirements are very often when we develop an User Interface in UI5 with ECC/CRM as back-end.

We can consume the components from ECC through GW Odata for developing the app in UI5. Now we can say that this is a well proposed solution from SAP. Similarly I am checking on the possibilities of developing print forms in applications developed in UI5.

Regards,

Rahul Muraleedharan.

Former Member
0 Kudos

In my opinion you can build the form using the SAPUI5 UI controls as i find there is a Form UI control

https://sapui5.netweaver.ondemand.com/sdk/#docs/api/symbols/sap.ui.commons.form.Form.html

Is that what you were looking for?

rahul_mb
Active Participant
0 Kudos

Hi Jimmy,

Thanks for the reply!

But the one I am referring to is entirely different from that you have suggested. Pardon me if my question was not clear. I am referring to the Print Forms like Adobe Forms in WDA. The one that you have suggested is just a UI control, in which we can place the fields on the screen in a specific form layout. What I need is a way to take the print/fax or email a document say for example, commercial invoice, just on a button click.

Regards,

Rahul Muraleedharan.