on 01-26-2014 10:44 PM
Hi all,
How can I show a PDF file retrieved via an ODATA service in to my SAPUI5 application? I have looked for some controls or api's but I can not find one in the SAPUI5 labrary. Also can not find any good information on the internet.
Can someone tell me a solution?
Kind regards,
Richard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For our solution we had to display a PDF from the ADS, and therefore got this directly from a URL.
Therefore we used a HTML Object from the Core library, sorry did not ask with part of SAPUI5 you were using.
We then created a OBJECT or IFRAME tag inside this to display the PDF, and had that point at URL end point that returned just the PDF Object itself.
A quick example of this would be something like this, and then just add the oHTML Content to a Control like an Overlay or something like this.
//Create Place holder for the iFrame using a HTML Object
var oHTML = new sap.ui.core.HTML();
//Set the iFrame up to call the Form Controller passing in the Form Data so the
var oContent = '<iframe id="iframeContentPanel" ' + 'src="formGetController.do?' + formData + '"width="100%" height=600px'"></iframe>';
oHTML.setContent(oContent);
It's not the complete answer, but hopefully will help.
Martin
Hi All,
I tried your solutions...I can able to View my pdf in Desktop....when i create apk It is going to blank screen
I am using SAP Netweaver Gateway service to show my pdf in mobile...Can you please give some idea to me ....
Thanks,
Karthik A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi R. Middelburg,
As explained earlier and in previous threads, there is no control in the SAPUI5 Framework that allows you to embed a PDF document within the application, as is possible in Web Dynpro using Adobe Document Services.
As I understand it, you are currently returning an xstring via OData services? Correct me if I am wrong.
I would like to suggest an alternative option: Business Document Services. In the backend, you could call the Adobe Document Services to return the PDF file and store it in Business Document Services. You can then retrieve the required information from the Business Document Services via the "BDS_BUSINESSDOCUMENT_GET_URL" Function Module and set the web_applic_server_url_only property to abap_true. This will return a URL that points to the requested document, which is stored in Business Document Services. You can then return this URL via OData to your SAPUI5 application.
Depending on the client (mobile or desktop) the url will download the file and display it. For example, if you open up the URL which links to a PDF file in Google Chrome, it will download it and open the file in a new tab in the browser. This will have to suffice until, hopefully, the SAPUI5 Framework allows embedding of documents as it is done in Web Dynpro.
I hope my suggestion is valuable to your scenario.
Kind regards
Miki von Ketelhodt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chandra,
I Have tryed the solution of the last replay!
`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.`
when I test my odata service with mime/type `application/pdf` in the service
PDFPayslipSet(PayslipMonth='01',PayslipType='',PayslipYear='2013')/$value I see my pdf.
when I test my odata service with mime/type `'image/jpeg'` in the service
PDFPayslipSet(PayslipMonth='01',PayslipType='',PayslipYear='2013')/$value I see my pdf.
I see a image error.
Normally I use sap.m.image to show images in my application, but I think can not use that for PDF´s
Now I,m looking for source to imbed the PDF.
Richard
HI,
How can we upload those file in MIME repository ?
My requirement is ==>
I have upload file in SAP-UI5, those file should upload in MIME repository (SAP-ECC)back end.
How can i do this?
I have referred below link (which is shown Gateway connection details).
Kindly help me on this...
HI,
How can we upload those file in MIME repository ?
My requirement is ==>
I have upload file in SAP-UI5, those file should upload in MIME repository (SAP-ECC)back end.
How can i do this?
I have referred below link (which is shown Gateway connection details).
Kindly help me on this...
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.