mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 16:46:11 +08:00
Add sheet for merged cells
I have added a new sheet to demonstrate that merged cells are ignored when using auto-size (MS Excel like behaviour).
This commit is contained in:
parent
3cfb536b02
commit
a74220e25f
|
@ -142,6 +142,23 @@ START-OF-SELECTION.
|
||||||
column_dimension = lo_worksheet->get_column_dimension( 'C' ).
|
column_dimension = lo_worksheet->get_column_dimension( 'C' ).
|
||||||
column_dimension->set_auto_size( ip_auto_size = abap_true ).
|
column_dimension->set_auto_size( ip_auto_size = abap_true ).
|
||||||
|
|
||||||
|
" Add sheet for merged cells
|
||||||
|
lo_worksheet = lo_excel->add_new_worksheet( ).
|
||||||
|
lo_worksheet->set_title( ip_title = 'Merged cells' ).
|
||||||
|
|
||||||
|
lo_worksheet->set_cell( ip_column = 'A' ip_row = 1 ip_value = 'This is a very long header text' ).
|
||||||
|
lo_worksheet->set_cell( ip_column = 'A' ip_row = 2 ip_value = 'Some data' ).
|
||||||
|
lo_worksheet->set_cell( ip_column = 'A' ip_row = 3 ip_value = 'Some more data' ).
|
||||||
|
|
||||||
|
lo_worksheet->set_merge(
|
||||||
|
EXPORTING
|
||||||
|
ip_column_start = 'A'
|
||||||
|
ip_column_end = 'C'
|
||||||
|
ip_row = 1 ).
|
||||||
|
|
||||||
|
column_dimension = lo_worksheet->get_column_dimension( 'A' ).
|
||||||
|
column_dimension->set_auto_size( ip_auto_size = abap_true ).
|
||||||
|
|
||||||
lo_excel->set_active_sheet_index( i_active_worksheet = 1 ).
|
lo_excel->set_active_sheet_index( i_active_worksheet = 1 ).
|
||||||
|
|
||||||
*** Create output
|
*** Create output
|
||||||
|
|
Loading…
Reference in New Issue
Block a user