07-01-2016 4:18 PM
Hey all,
I have created an ALV tree using the following classes:
go_container_tree TYPE REF TO cl_gui_custom_container,
go_alv_tree TYPE REF TO cl_gui_alv_tree,
and I also created his HTML header followingly:
DATA: lo_header TYPE REF TO cl_gui_html_viewer,
lo_dyndoc TYPE REF TO cl_dd_document.
* Get Header
CALL METHOD po_tree->get_html_header_object
CHANGING
er_html_header = lo_header.
* Build Dynamic Document
CREATE OBJECT lo_dyndoc.
" added some texts to the lo_dyndoc
lo_dyndoc->html_control = lo_header.
CALL METHOD lo_dyndoc->display_document
EXPORTING
reuse_control = 'X'
EXCEPTIONS
html_display_error = 1.
I would like to set the height of the HTML header according to the added texts (that means I do not want a vertical scrollbar)
This is how it looks like now:
And this is what I would like to achieve (resize the header according to the added text):
I tried to set it manually with the following code, but it does not work.
CALL METHOD lo_header->set_height
EXPORTING
height = 100.
How can I set the automatic resizing of the header according to the added text or at least how can I set the height of the header?
Thank you.
Regards,
RB
07-02-2016 7:38 AM
I think you should use the method:
CALL METHOD po_tree->set_splitter_row_height( 100 ).
07-02-2016 7:38 AM
I think you should use the method:
CALL METHOD po_tree->set_splitter_row_height( 100 ).
07-04-2016 6:21 PM
Yeh this is working but I still have to set up automatic resizing according to the content and window size.
07-04-2016 7:38 PM
I'm afraid calculating automatically the height of the content of the HTML viewer requires embedding javascript in it (easy if you program directly the HTML viewer, but maybe not so easy if you use DD), for triggering an event at the onReady javascript event and transmit the offsetHeight of the main HTML element (<body onready="javascript:...getElementsById('sapeventlink').click( );"> with <a href="SAPEVENT:action(...)" id="sapeventlink"> and handle the SAPEVENT event of the HTML viewer to get values).
07-04-2016 8:08 PM
well this is really a bit complicated
I was also thinking about checking whether there is a scrollbar and If so I would increase the height until there is no scrollbar. Is it possible to check whether there is a vertical scrollbar, I could not find it.
07-05-2016 7:03 AM