Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

How to display .doc/.docx files inside a controller

$
0
0

Hi,

 

I've been tring to display a word document inside a custom controller.

I've tried : cl_gui_html_viewer

 

CHANGING po_html_viewer TYPE REF TO cl_gui_html_viewer.

 

   po_html_viewer->show_url(

     EXPORTING

       url                        = lv_url    " URL

       in_place               = abap_true

     EXCEPTIONS

       cntl_error                     = 1

       cnht_error_not_allowed = 2

       cnht_error_parameter   = 3

       dp_error_general          = 4

       OTHERS                      = 5

   ).

 

 

and document viwer :

 

FORM build_doc_viewer  USING    po_splitter   TYPE REF TO cl_gui_splitter_container

                        CHANGING po_doc_viewer TYPE REF TO i_oi_document_viewer.

 

   DATA : lo_tmp_container TYPE REF TO cl_gui_container.

 

   lo_tmp_container = po_splitter->get_container( row = 1 column   = 1 ).

 

   CALL METHOD c_oi_container_control_creator=>get_document_viewer

     IMPORTING

       viewer = po_doc_viewer.

 

   CALL METHOD po_doc_viewer->init_viewer

     EXPORTING

       parent = lo_tmp_container.

 

   CALL METHOD po_doc_viewer->view_document_from_url

     EXPORTING

       document_url = 'C:\USERS\ZIV\DOCUMENTS\SAP\TEST.DOCX'

       show_inplace = 'X'.

ENDFORM.                    " BUILD_DOC_VIEWER

 

 

In both cases the document is displayed in a popup of a word application and not "in place" (inside a controller) as I wanted.

 

What am I doing worng ? Is there another solution ?

 

Thanks

Ziv.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>