From 92453b9b3dd5864d790d8551dad4d30abdc2dffe Mon Sep 17 00:00:00 2001 From: RixarSAP <168567887+RixarSAP@users.noreply.github.com> Date: Thu, 2 May 2024 11:15:01 +0200 Subject: [PATCH] Update zcl_excel_writer_2007.clas.abap - Size of comments Modified method CREATE_XL_DRAWING_FOR_COMMENTS to have the possibility to change the size of the comments --- src/zcl_excel_writer_2007.clas.abap | 32 ++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/zcl_excel_writer_2007.clas.abap b/src/zcl_excel_writer_2007.clas.abap index b532db4..9f47a57 100644 --- a/src/zcl_excel_writer_2007.clas.abap +++ b/src/zcl_excel_writer_2007.clas.abap @@ -3297,7 +3297,37 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. lo_element_clientdata->append_child( new_child = lo_element_sizewithcells ). lo_element_anchor = lo_document->create_simple_element( name = lc_xml_node_anchor parent = lo_document ). - lo_element_anchor->set_value( '2, 15, 11, 10, 4, 31, 15, 9' ). + + +*--------------------------------------------------------------------* +* Ricardo R. - 2024.05.02 +*--------------------------------------------------------------------* + DATA: + lv_anchor TYPE string, + lv_height type i, + lv_width TYPE i, + lv_height_str type string, + lv_width_str TYPE string. + + CONSTANTS: + lc_anchor_init TYPE string VALUE '0, 1, 11, 10, &width&, 31, &height&, 9'. + + CALL METHOD lo_comment->get_size + IMPORTING + ep_width = lv_width + ep_height = lv_height. + + lv_width_str = lv_width. + lv_height_str = lv_height. + + lv_anchor = lc_anchor_init. + REPLACE '&height&' WITH lv_height_str INTO lv_anchor. + REPLACE '&width&' WITH lv_width_str INTO lv_anchor. + lo_element_anchor->set_value( lv_anchor ). + +* lo_element_anchor->set_value( '2, 15, 11, 10, 4, 31, 15, 9' ). "Original line +*--------------------------------------------------------------------* + lo_element_clientdata->append_child( new_child = lo_element_anchor ). lo_element_autofill = lo_document->create_simple_element( name = lc_xml_node_autofill parent = lo_document ).