04-17-2014 4:02 PM
Hello gurus,
Does anyone know if there is any way (using any kind of technology) to print big characters in a standard dynpro?
So far I used class 'cl_dd_document' in custom containers but letters are not enough big.
Thanks in advance,
Eloi
04-17-2014 6:58 PM
Dear Eloi,
Assuming that is a standard dynpro, I believe that you have found a screen-exit.
So, you can do this writing a HTML code into a custom container.
DATA: i_result_html TYPE TABLE OF w3_html,
i_result_it TYPE TABLE OF string,
e_result_wa TYPE string,
gv_url TYPE c LENGTH 255,
gv_n TYPE i.
DATA: o_container TYPE REF TO cl_gui_custom_container,
o_html_viewer TYPE REF TO cl_gui_html_viewer.
CLEAR: i_result_html,
i_result_it,
gv_url.
* HTML + CSS (Cascading Style Sheets)
APPEND '<html><head><style type="text/css">' TO i_result_html.
APPEND 'body {' TO i_result_html.
APPEND 'background-color: #F2F2F2;' TO i_result_html.
APPEND 'overflow: hidden;' TO i_result_html.
APPEND 'color: #F2F2F2;' TO i_result_html.
APPEND 'border-style: solid;' TO i_result_html.
APPEND 'font-size: 21px;' TO i_result_html. <--- FONT SIZE!!!
APPEND 'font-family: Arial;' TO i_result_html.
APPEND 'font-weight: bold;' TO i_result_html.
APPEND 'margin-top: 0px;' TO i_result_html.
APPEND 'margin-bottom: 0px;' TO i_result_html.
APPEND 'margin-left: 0px;' TO i_result_html.
APPEND 'margin-right: 0px;' TO i_result_html.
APPEND 'text-align: right;}' TO i_result_html.
APPEND '</style></head>' TO i_result_html.
APPEND '<body><div>' TO i_result_html.
APPEND '<font color="red">' TO i_result_html.
* WRITE YOUR BIG CHARACTERS RIGHT HERE...
APPEND 'BIG CHARACTERS!!11!' TO i_result_it.
PERFORM f_append_html_message.
* CLOSING HTML CODE...
APPEND '</font>' TO i_result_html.
APPEND '</div></body></html>' TO i_result_html.
IF o_container IS INITIAL AND o_html_viewer IS INITIAL.
* CREATE CONTAINER OBJECT
CREATE OBJECT o_container
EXPORTING
container_name = 'CONTAINER'. <--- CUSTOM CONTAINER NAME
* CREATE HTML OBJECT
CREATE OBJECT o_html_viewer
EXPORTING
parent = o_container.
ENDIF.
* LOADING HTML CODE AND ASSIGN IT INTO AN URL...
o_html_viewer->load_data( IMPORTING assigned_url = gv_url
CHANGING data_table = i_result_html ).
* DISPLAY HTML CONTENT!
o_html_viewer->show_url( url = gv_url ).
*&---------------------------------------------------------------------*
*& Form F_APPEND_HTML_MESSAGE
*&---------------------------------------------------------------------*
FORM f_append_html_message .
CONCATENATE LINES OF i_result_it INTO e_result_wa.
CLEAR i_result_it.
gv_n = STRLEN( e_result_wa ).
WHILE gv_n > 255.
APPEND e_result_wa(255) TO i_result_html.
SHIFT e_result_wa LEFT BY 255 PLACES.
SUBTRACT 255 FROM gv_n.
ENDWHILE.
APPEND e_result_wa TO i_result_html.
ENDFORM. " F_APPEND_HTML_MESSAGE
Rewardful points if useful!
Regards,
João
04-17-2014 5:59 PM
04-17-2014 6:58 PM
Dear Eloi,
Assuming that is a standard dynpro, I believe that you have found a screen-exit.
So, you can do this writing a HTML code into a custom container.
DATA: i_result_html TYPE TABLE OF w3_html,
i_result_it TYPE TABLE OF string,
e_result_wa TYPE string,
gv_url TYPE c LENGTH 255,
gv_n TYPE i.
DATA: o_container TYPE REF TO cl_gui_custom_container,
o_html_viewer TYPE REF TO cl_gui_html_viewer.
CLEAR: i_result_html,
i_result_it,
gv_url.
* HTML + CSS (Cascading Style Sheets)
APPEND '<html><head><style type="text/css">' TO i_result_html.
APPEND 'body {' TO i_result_html.
APPEND 'background-color: #F2F2F2;' TO i_result_html.
APPEND 'overflow: hidden;' TO i_result_html.
APPEND 'color: #F2F2F2;' TO i_result_html.
APPEND 'border-style: solid;' TO i_result_html.
APPEND 'font-size: 21px;' TO i_result_html. <--- FONT SIZE!!!
APPEND 'font-family: Arial;' TO i_result_html.
APPEND 'font-weight: bold;' TO i_result_html.
APPEND 'margin-top: 0px;' TO i_result_html.
APPEND 'margin-bottom: 0px;' TO i_result_html.
APPEND 'margin-left: 0px;' TO i_result_html.
APPEND 'margin-right: 0px;' TO i_result_html.
APPEND 'text-align: right;}' TO i_result_html.
APPEND '</style></head>' TO i_result_html.
APPEND '<body><div>' TO i_result_html.
APPEND '<font color="red">' TO i_result_html.
* WRITE YOUR BIG CHARACTERS RIGHT HERE...
APPEND 'BIG CHARACTERS!!11!' TO i_result_it.
PERFORM f_append_html_message.
* CLOSING HTML CODE...
APPEND '</font>' TO i_result_html.
APPEND '</div></body></html>' TO i_result_html.
IF o_container IS INITIAL AND o_html_viewer IS INITIAL.
* CREATE CONTAINER OBJECT
CREATE OBJECT o_container
EXPORTING
container_name = 'CONTAINER'. <--- CUSTOM CONTAINER NAME
* CREATE HTML OBJECT
CREATE OBJECT o_html_viewer
EXPORTING
parent = o_container.
ENDIF.
* LOADING HTML CODE AND ASSIGN IT INTO AN URL...
o_html_viewer->load_data( IMPORTING assigned_url = gv_url
CHANGING data_table = i_result_html ).
* DISPLAY HTML CONTENT!
o_html_viewer->show_url( url = gv_url ).
*&---------------------------------------------------------------------*
*& Form F_APPEND_HTML_MESSAGE
*&---------------------------------------------------------------------*
FORM f_append_html_message .
CONCATENATE LINES OF i_result_it INTO e_result_wa.
CLEAR i_result_it.
gv_n = STRLEN( e_result_wa ).
WHILE gv_n > 255.
APPEND e_result_wa(255) TO i_result_html.
SHIFT e_result_wa LEFT BY 255 PLACES.
SUBTRACT 255 FROM gv_n.
ENDWHILE.
APPEND e_result_wa TO i_result_html.
ENDFORM. " F_APPEND_HTML_MESSAGE
Rewardful points if useful!
Regards,
João
04-18-2014 10:13 AM