mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 19:16:10 +08:00
Merge remote-tracking branch 'upstream/main' into sandraros/load-of-empty-cell-address
This commit is contained in:
commit
dd463176bf
|
@ -9,12 +9,21 @@ CLASS zcl_excel_comment DEFINITION
|
||||||
CONSTANTS default_bottom_row TYPE i VALUE 15. "#EC NOTEXT
|
CONSTANTS default_bottom_row TYPE i VALUE 15. "#EC NOTEXT
|
||||||
|
|
||||||
METHODS constructor .
|
METHODS constructor .
|
||||||
|
METHODS get_bottom_offset
|
||||||
|
RETURNING
|
||||||
|
VALUE(rp_result) TYPE i .
|
||||||
METHODS get_bottom_row
|
METHODS get_bottom_row
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rp_result) TYPE i .
|
VALUE(rp_result) TYPE i .
|
||||||
METHODS get_index
|
METHODS get_index
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rp_index) TYPE string .
|
VALUE(rp_index) TYPE string .
|
||||||
|
METHODS get_left_column
|
||||||
|
RETURNING
|
||||||
|
VALUE(rp_result) TYPE i .
|
||||||
|
METHODS get_left_offset
|
||||||
|
RETURNING
|
||||||
|
VALUE(rp_result) TYPE i .
|
||||||
METHODS get_name
|
METHODS get_name
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(r_name) TYPE string .
|
VALUE(r_name) TYPE string .
|
||||||
|
@ -24,24 +33,45 @@ CLASS zcl_excel_comment DEFINITION
|
||||||
METHODS get_right_column
|
METHODS get_right_column
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rp_result) TYPE i .
|
VALUE(rp_result) TYPE i .
|
||||||
|
METHODS get_right_offset
|
||||||
|
RETURNING
|
||||||
|
VALUE(rp_result) TYPE i .
|
||||||
METHODS get_text
|
METHODS get_text
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rp_text) TYPE string .
|
VALUE(rp_text) TYPE string .
|
||||||
|
METHODS get_top_offset
|
||||||
|
RETURNING
|
||||||
|
VALUE(rp_result) TYPE i .
|
||||||
|
METHODS get_top_row
|
||||||
|
RETURNING
|
||||||
|
VALUE(rp_result) TYPE i .
|
||||||
METHODS set_text
|
METHODS set_text
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!ip_text TYPE string
|
!ip_text TYPE string
|
||||||
!ip_ref TYPE string OPTIONAL
|
!ip_ref TYPE string OPTIONAL
|
||||||
!ip_right_column TYPE i OPTIONAL
|
!ip_left_column TYPE i DEFAULT 2
|
||||||
!ip_bottom_row TYPE i OPTIONAL .
|
!ip_left_offset TYPE i DEFAULT 15
|
||||||
|
!ip_top_row TYPE i DEFAULT 11
|
||||||
|
!ip_top_offset TYPE i DEFAULT 10
|
||||||
|
!ip_right_column TYPE i DEFAULT default_right_column
|
||||||
|
!ip_right_offset TYPE i DEFAULT 31
|
||||||
|
!ip_bottom_row TYPE i DEFAULT default_bottom_row
|
||||||
|
!ip_bottom_offset TYPE i DEFAULT 9.
|
||||||
|
|
||||||
PROTECTED SECTION.
|
PROTECTED SECTION.
|
||||||
PRIVATE SECTION.
|
PRIVATE SECTION.
|
||||||
|
|
||||||
|
DATA bottom_offset TYPE i .
|
||||||
DATA bottom_row TYPE i .
|
DATA bottom_row TYPE i .
|
||||||
DATA index TYPE string .
|
DATA index TYPE string .
|
||||||
DATA ref TYPE string .
|
DATA ref TYPE string .
|
||||||
|
DATA left_column TYPE i .
|
||||||
|
DATA left_offset TYPE i .
|
||||||
DATA right_column TYPE i .
|
DATA right_column TYPE i .
|
||||||
|
DATA right_offset TYPE i .
|
||||||
DATA text TYPE string .
|
DATA text TYPE string .
|
||||||
|
DATA top_offset TYPE i .
|
||||||
|
DATA top_row TYPE i .
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,6 +84,11 @@ CLASS zcl_excel_comment IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD get_bottom_offset.
|
||||||
|
rp_result = bottom_offset.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD get_bottom_row.
|
METHOD get_bottom_row.
|
||||||
rp_result = bottom_row.
|
rp_result = bottom_row.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
@ -64,6 +99,16 @@ CLASS zcl_excel_comment IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD get_left_column.
|
||||||
|
rp_result = left_column.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD get_left_offset.
|
||||||
|
rp_result = left_offset.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD get_name.
|
METHOD get_name.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
@ -79,11 +124,26 @@ CLASS zcl_excel_comment IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD get_right_offset.
|
||||||
|
rp_result = right_offset.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD get_text.
|
METHOD get_text.
|
||||||
rp_text = me->text.
|
rp_text = me->text.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD get_top_offset.
|
||||||
|
rp_result = top_offset.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD get_top_row.
|
||||||
|
rp_result = top_row.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD set_text.
|
METHOD set_text.
|
||||||
me->text = ip_text.
|
me->text = ip_text.
|
||||||
|
|
||||||
|
@ -91,17 +151,25 @@ CLASS zcl_excel_comment IMPLEMENTATION.
|
||||||
me->ref = ip_ref.
|
me->ref = ip_ref.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
|
me->left_column = ip_left_column.
|
||||||
|
me->left_offset = ip_left_offset.
|
||||||
|
|
||||||
|
me->top_row = ip_top_row.
|
||||||
|
me->top_offset = ip_top_offset.
|
||||||
|
|
||||||
IF ip_right_column IS NOT INITIAL.
|
IF ip_right_column IS NOT INITIAL.
|
||||||
me->right_column = ip_right_column.
|
me->right_column = ip_right_column.
|
||||||
ELSE.
|
ELSE.
|
||||||
me->right_column = default_right_column.
|
me->right_column = default_right_column.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
me->right_offset = ip_right_offset.
|
||||||
|
|
||||||
IF ip_bottom_row IS NOT INITIAL.
|
IF ip_bottom_row IS NOT INITIAL.
|
||||||
me->bottom_row = ip_bottom_row.
|
me->bottom_row = ip_bottom_row.
|
||||||
ELSE.
|
ELSE.
|
||||||
me->bottom_row = default_bottom_row.
|
me->bottom_row = default_bottom_row.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
me->bottom_offset = ip_bottom_offset.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
|
@ -1083,6 +1083,10 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
|
||||||
|
|
||||||
lv_column_alpha = zcl_excel_common=>convert_column2alpha( lv_column_int ).
|
lv_column_alpha = zcl_excel_common=>convert_column2alpha( lv_column_int ).
|
||||||
|
|
||||||
|
IF <ls_field_catalog>-width IS NOT INITIAL.
|
||||||
|
set_column_width( ip_column = lv_column_alpha ip_width_fix = <ls_field_catalog>-width ).
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
" First of all write column header
|
" First of all write column header
|
||||||
IF <ls_field_catalog>-style_header IS NOT INITIAL.
|
IF <ls_field_catalog>-style_header IS NOT INITIAL.
|
||||||
me->set_cell( ip_column = lv_column_alpha
|
me->set_cell( ip_column = lv_column_alpha
|
||||||
|
|
|
@ -269,6 +269,11 @@ CLASS zcl_excel_writer_2007 DEFINITION
|
||||||
!ip_flag TYPE flag
|
!ip_flag TYPE flag
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(ep_boolean) TYPE tv_charbool .
|
VALUE(ep_boolean) TYPE tv_charbool .
|
||||||
|
METHODS number2string
|
||||||
|
IMPORTING
|
||||||
|
!ip_number TYPE numeric
|
||||||
|
RETURNING
|
||||||
|
VALUE(ep_string) TYPE string.
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
@ -3139,7 +3144,6 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
||||||
lc_xml_attr_val_none TYPE string VALUE 'none',
|
lc_xml_attr_val_none TYPE string VALUE 'none',
|
||||||
lc_xml_attr_val_msodir TYPE string VALUE 'mso-direction-alt:auto',
|
lc_xml_attr_val_msodir TYPE string VALUE 'mso-direction-alt:auto',
|
||||||
lc_xml_attr_val_note TYPE string VALUE 'Note'.
|
lc_xml_attr_val_note TYPE string VALUE 'Note'.
|
||||||
CONSTANTS lc_anchor_init TYPE string VALUE '2, 15, 11, 10, &right_column&, 31, &bottom_row&, 9'.
|
|
||||||
|
|
||||||
|
|
||||||
DATA: lo_document TYPE REF TO if_ixml_document,
|
DATA: lo_document TYPE REF TO if_ixml_document,
|
||||||
|
@ -3181,6 +3185,10 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
||||||
DATA lv_right_column TYPE i.
|
DATA lv_right_column TYPE i.
|
||||||
DATA lv_bottom_row_str TYPE string.
|
DATA lv_bottom_row_str TYPE string.
|
||||||
DATA lv_right_column_str TYPE string.
|
DATA lv_right_column_str TYPE string.
|
||||||
|
DATA lv_top_row TYPE i.
|
||||||
|
DATA lv_left_column TYPE i.
|
||||||
|
DATA lv_top_row_str TYPE string.
|
||||||
|
DATA lv_left_column_str TYPE string.
|
||||||
|
|
||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
|
@ -3310,17 +3318,14 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
||||||
" Offsets are a number of pixels.
|
" Offsets are a number of pixels.
|
||||||
" Reference: Anchor Class at
|
" Reference: Anchor Class at
|
||||||
" https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.vml.spreadsheet.anchor?view=openxml-3.0.1
|
" https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.vml.spreadsheet.anchor?view=openxml-3.0.1
|
||||||
lv_right_column = lo_comment->get_right_column( ).
|
lv_anchor = number2string( lo_comment->get_left_column( ) )
|
||||||
lv_bottom_row = lo_comment->get_bottom_row( ).
|
&& `, ` && number2string( lo_comment->get_left_offset( ) )
|
||||||
|
&& `, ` && number2string( lo_comment->get_top_row( ) )
|
||||||
lv_right_column_str = lv_right_column.
|
&& `, ` && number2string( lo_comment->get_top_offset( ) )
|
||||||
CONDENSE lv_right_column_str.
|
&& `, ` && number2string( lo_comment->get_right_column( ) )
|
||||||
lv_bottom_row_str = lv_bottom_row.
|
&& `, ` && number2string( lo_comment->get_right_offset( ) )
|
||||||
CONDENSE lv_bottom_row_str.
|
&& `, ` && number2string( lo_comment->get_bottom_row( ) )
|
||||||
|
&& `, ` && number2string( lo_comment->get_bottom_offset( ) ).
|
||||||
lv_anchor = lc_anchor_init.
|
|
||||||
REPLACE '&right_column&' WITH lv_right_column_str INTO lv_anchor.
|
|
||||||
REPLACE '&bottom_row&' WITH lv_bottom_row_str INTO lv_anchor.
|
|
||||||
lo_element_anchor->set_value( lv_anchor ).
|
lo_element_anchor->set_value( lv_anchor ).
|
||||||
|
|
||||||
lo_element_clientdata->append_child( new_child = lo_element_anchor ).
|
lo_element_clientdata->append_child( new_child = lo_element_anchor ).
|
||||||
|
@ -6224,6 +6229,12 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD number2string.
|
||||||
|
ep_string = ip_number.
|
||||||
|
CONDENSE ep_string.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD render_xml_document.
|
METHOD render_xml_document.
|
||||||
DATA lo_streamfactory TYPE REF TO if_ixml_stream_factory.
|
DATA lo_streamfactory TYPE REF TO if_ixml_stream_factory.
|
||||||
DATA lo_ostream TYPE REF TO if_ixml_ostream.
|
DATA lo_ostream TYPE REF TO if_ixml_ostream.
|
||||||
|
|
|
@ -123,6 +123,12 @@
|
||||||
<ADMINFIELD>0</ADMINFIELD>
|
<ADMINFIELD>0</ADMINFIELD>
|
||||||
<COMPTYPE>E</COMPTYPE>
|
<COMPTYPE>E</COMPTYPE>
|
||||||
</DD03P>
|
</DD03P>
|
||||||
|
<DD03P>
|
||||||
|
<FIELDNAME>WIDTH</FIELDNAME>
|
||||||
|
<ROLLNAME>INT4</ROLLNAME>
|
||||||
|
<ADMINFIELD>0</ADMINFIELD>
|
||||||
|
<COMPTYPE>E</COMPTYPE>
|
||||||
|
</DD03P>
|
||||||
</DD03P_TABLE>
|
</DD03P_TABLE>
|
||||||
<I18N_LANGS>
|
<I18N_LANGS>
|
||||||
<LANGU>1</LANGU>
|
<LANGU>1</LANGU>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user