Skip to Content
0

SAP UI5 PDF is not rendering on IFrame

Dec 28, 2017 at 07:18 AM

48

avatar image

Hi Friends,

We are trying read Smart form and show it as pdf on the Fiori Tile.

OData Service: Redefined get_Entity, getStream methods.

UI5: Display PDF button, on click of it, Iframe should show the pdf.

Now UI5 screen directly asking for save pdf, it is not rendering on iframe, please check the attached files and let me the issue.

sap-fiori-tile.jpg

odata-service-code.txt

ui5code1.txt

Thanks,

Prasad

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

1 Answer

Irfan Gokak Dec 28, 2017 at 08:19 AM
0

Hi Lakshmi,

Please try this code.

*---Set File Name for the file to be downloded
    ls_lheader-name = 'Content-Disposition'.
*    ls_lheader-value = 'outline; filename=Mobile.pdf;'.
    concatenate 'outline; filename=' ls_zzupld-filename INTO ls_lheader-value.
    set_header( is_header = ls_lheader ).
    CLEAR ls_lheader.


*---Set Content Type in header
    ls_lheader-name = 'Content-Type'.
    ls_lheader-value = ls_zzupld-mimetype.
    set_header( is_header = ls_lheader ).
    CLEAR ls_lheader.

    ls_stream-mime_type = ls_zzupld-mimetype.
    ls_stream-value = ls_zzupld-value.
    copy_data_to_ref(
  EXPORTING
    is_data = ls_stream CHANGING
      cr_data = er_stream ).
Share
10 |10000 characters needed characters left characters exceeded