Skip to Content

Sapui5 - Xml view open pdf

Hi, I'm developing a Fiori custom web application and I need to open a pdf file in a xml view.

I've develop a custom oData service for implementing the method


Returning the data stream as:

ls_stream-value = l_value.
ls_stream-mime_type = 'application/pdf'.
copy_data_to_ref( EXPORTING is_data = ls_stream
                              CHANGING  cr_data = er_stream )

In xml view I've put

<core:HTML id="idFrame"/>

The relative controller is

var html = this.getView().byId("idFrame");
var url = "/sap/opu/odata/sap/*****('YYYYY')/$value";
html.setContent('<iframe src="' + url +'" width="100%" height="100%"></iframe>');

When I open the view nothing appears and in Chrome console I've got this message

How can I solve it out?

Kind regards,


Capture.PNG (3.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jun 15, 2016 at 06:33 AM

    What is the result if you call the URL http://<host>:<port>/sap/opu/odata/sap/*****('YYYYY')/$value in the browser? Does it open the PDF?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 15, 2016 at 09:37 AM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.