Skip to Content

SAP UI5 PDF is not rendering on IFrame

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 28, 2017 at 08:19 AM

    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 ).
    
    Add comment
    10|10000 characters needed characters exceeded