mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 11:06:15 +08:00
Merge 3501ec6209
into 08c794f3ca
This commit is contained in:
commit
aee6bf61a5
|
@ -152,7 +152,7 @@ CLASS zcl_excel_converter_alv IMPLEMENTATION.
|
||||||
ls_color-int = 0.
|
ls_color-int = 0.
|
||||||
ls_color-inv = 0.
|
ls_color-inv = 0.
|
||||||
ls_color-fontcolor = 'FF000000'.
|
ls_color-fontcolor = 'FF000000'.
|
||||||
ls_color-fillcolor = 'FFE5EAF0'. " 229 234 240 gray
|
ls_color-fillcolor = 'FFDFEBF5'. " 223 235 245 gray
|
||||||
INSERT ls_color INTO TABLE wt_colors.
|
INSERT ls_color INTO TABLE wt_colors.
|
||||||
|
|
||||||
ls_color-col = 2.
|
ls_color-col = 2.
|
||||||
|
@ -210,7 +210,7 @@ CLASS zcl_excel_converter_alv IMPLEMENTATION.
|
||||||
ls_color-int = 0.
|
ls_color-int = 0.
|
||||||
ls_color-inv = 0.
|
ls_color-inv = 0.
|
||||||
ls_color-fontcolor = 'FF000000'. " 000 000 000 Black
|
ls_color-fontcolor = 'FF000000'. " 000 000 000 Black
|
||||||
ls_color-fillcolor = 'FFCEE7FB'. " 206 231 251 light blue
|
ls_color-fillcolor = 'FFCCE3E3'. " 204 227 227 light blue
|
||||||
INSERT ls_color INTO TABLE wt_colors.
|
INSERT ls_color INTO TABLE wt_colors.
|
||||||
|
|
||||||
ls_color-col = 4.
|
ls_color-col = 4.
|
||||||
|
@ -239,7 +239,7 @@ CLASS zcl_excel_converter_alv IMPLEMENTATION.
|
||||||
ls_color-int = 0.
|
ls_color-int = 0.
|
||||||
ls_color-inv = 0.
|
ls_color-inv = 0.
|
||||||
ls_color-fontcolor = 'FF000000'. " 000 000 000 Black
|
ls_color-fontcolor = 'FF000000'. " 000 000 000 Black
|
||||||
ls_color-fillcolor = 'FFCEF8AE'. " 206 248 174 Green
|
ls_color-fillcolor = 'FFC6F9C1'. " 198 249 193 Green
|
||||||
INSERT ls_color INTO TABLE wt_colors.
|
INSERT ls_color INTO TABLE wt_colors.
|
||||||
|
|
||||||
ls_color-col = 5.
|
ls_color-col = 5.
|
||||||
|
@ -268,7 +268,7 @@ CLASS zcl_excel_converter_alv IMPLEMENTATION.
|
||||||
ls_color-int = 0.
|
ls_color-int = 0.
|
||||||
ls_color-inv = 0.
|
ls_color-inv = 0.
|
||||||
ls_color-fontcolor = 'FF000000'. " 000 000 000 Black
|
ls_color-fontcolor = 'FF000000'. " 000 000 000 Black
|
||||||
ls_color-fillcolor = 'FFFDBBBC'. " 253 187 188 Red
|
ls_color-fillcolor = 'FFFF988C'. " 255 152 140 Red
|
||||||
INSERT ls_color INTO TABLE wt_colors.
|
INSERT ls_color INTO TABLE wt_colors.
|
||||||
|
|
||||||
ls_color-col = 6.
|
ls_color-col = 6.
|
||||||
|
@ -292,6 +292,20 @@ CLASS zcl_excel_converter_alv IMPLEMENTATION.
|
||||||
ls_color-fillcolor = 'FFFFFFFF'. " 255 255 255 White
|
ls_color-fillcolor = 'FFFFFFFF'. " 255 255 255 White
|
||||||
INSERT ls_color INTO TABLE wt_colors.
|
INSERT ls_color INTO TABLE wt_colors.
|
||||||
|
|
||||||
|
ls_color-col = 7.
|
||||||
|
ls_color-int = 0.
|
||||||
|
ls_color-inv = 0.
|
||||||
|
ls_color-fontcolor = 'FF000000'. " 000 000 000 Black
|
||||||
|
ls_color-fillcolor = 'FFF8E5C8'. " 246 229 204
|
||||||
|
INSERT ls_color INTO TABLE wt_colors.
|
||||||
|
|
||||||
|
ls_color-col = 7.
|
||||||
|
ls_color-int = 1.
|
||||||
|
ls_color-inv = 0.
|
||||||
|
ls_color-fontcolor = 'FF000000'. " 000 000 000 Black
|
||||||
|
ls_color-fillcolor = 'FFFDBB71'. " 255 186 106
|
||||||
|
INSERT ls_color INTO TABLE wt_colors.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,12 @@ CLASS zcl_excel_drawing DEFINITION
|
||||||
METHODS load_chart_attributes
|
METHODS load_chart_attributes
|
||||||
IMPORTING
|
IMPORTING
|
||||||
VALUE(ip_chart) TYPE REF TO if_ixml_document .
|
VALUE(ip_chart) TYPE REF TO if_ixml_document .
|
||||||
|
METHODS set_reference_drawing
|
||||||
|
IMPORTING
|
||||||
|
!ip_ref TYPE REF TO zcl_excel_drawing.
|
||||||
|
METHODS get_reference_guid
|
||||||
|
RETURNING
|
||||||
|
VALUE(ep_guid) TYPE zexcel_guid.
|
||||||
PROTECTED SECTION.
|
PROTECTED SECTION.
|
||||||
PRIVATE SECTION.
|
PRIVATE SECTION.
|
||||||
|
|
||||||
|
@ -141,6 +147,7 @@ CLASS zcl_excel_drawing DEFINITION
|
||||||
DATA from_loc TYPE zexcel_drawing_location .
|
DATA from_loc TYPE zexcel_drawing_location .
|
||||||
DATA to_loc TYPE zexcel_drawing_location .
|
DATA to_loc TYPE zexcel_drawing_location .
|
||||||
DATA size TYPE zexcel_drawing_size .
|
DATA size TYPE zexcel_drawing_size .
|
||||||
|
DATA reference_drawing TYPE REF TO zcl_excel_drawing.
|
||||||
CONSTANTS c_ixml_iid_element TYPE i VALUE 130.
|
CONSTANTS c_ixml_iid_element TYPE i VALUE 130.
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
@ -1133,4 +1140,12 @@ CLASS ZCL_EXCEL_DRAWING IMPLEMENTATION.
|
||||||
me->anchor = lv_anchor.
|
me->anchor = lv_anchor.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
METHOD set_reference_drawing.
|
||||||
|
reference_drawing = ip_ref.
|
||||||
|
ENDMETHOD.
|
||||||
|
METHOD get_reference_guid.
|
||||||
|
IF reference_drawing IS BOUND.
|
||||||
|
ep_guid = reference_drawing->get_guid( ).
|
||||||
|
ENDIF.
|
||||||
|
ENDMETHOD.
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
|
@ -553,6 +553,9 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
||||||
WHILE lo_iterator->has_next( ) EQ abap_true.
|
WHILE lo_iterator->has_next( ) EQ abap_true.
|
||||||
lo_drawing ?= lo_iterator->get_next( ).
|
lo_drawing ?= lo_iterator->get_next( ).
|
||||||
|
|
||||||
|
"do not add media from drawing with reference
|
||||||
|
CHECK lo_drawing->get_reference_guid( ) IS INITIAL.
|
||||||
|
|
||||||
lv_content = lo_drawing->get_media( ).
|
lv_content = lo_drawing->get_media( ).
|
||||||
lv_value = lo_drawing->get_media_name( ).
|
lv_value = lo_drawing->get_media_name( ).
|
||||||
CONCATENATE 'xl/media/' lv_value INTO lv_value.
|
CONCATENATE 'xl/media/' lv_value INTO lv_value.
|
||||||
|
@ -2630,7 +2633,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
||||||
lo_drawing TYPE REF TO zcl_excel_drawing.
|
lo_drawing TYPE REF TO zcl_excel_drawing.
|
||||||
|
|
||||||
DATA: lv_value TYPE string,
|
DATA: lv_value TYPE string,
|
||||||
lv_counter TYPE i.
|
lv_guid TYPE c LENGTH 32.
|
||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* STEP 1: Create [Content_Types].xml into the root of the ZIP
|
* STEP 1: Create [Content_Types].xml into the root of the ZIP
|
||||||
|
@ -2647,16 +2650,16 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
||||||
* STEP 4: Create subnodes
|
* STEP 4: Create subnodes
|
||||||
|
|
||||||
" Add sheet Relationship nodes here
|
" Add sheet Relationship nodes here
|
||||||
lv_counter = 0.
|
|
||||||
lo_drawings = io_worksheet->get_drawings( ).
|
lo_drawings = io_worksheet->get_drawings( ).
|
||||||
lo_iterator = lo_drawings->get_iterator( ).
|
lo_iterator = lo_drawings->get_iterator( ).
|
||||||
WHILE lo_iterator->has_next( ) EQ abap_true.
|
WHILE lo_iterator->has_next( ) EQ abap_true.
|
||||||
lo_drawing ?= lo_iterator->get_next( ).
|
lo_drawing ?= lo_iterator->get_next( ).
|
||||||
ADD 1 TO lv_counter.
|
|
||||||
|
|
||||||
lv_value = lv_counter.
|
CHECK lo_drawing->get_reference_guid( ) IS INITIAL.
|
||||||
CONDENSE lv_value.
|
|
||||||
CONCATENATE 'rId' lv_value INTO lv_value.
|
lv_guid = lo_drawing->get_guid( ).
|
||||||
|
|
||||||
|
CONCATENATE 'rId' lv_guid INTO lv_value.
|
||||||
|
|
||||||
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
|
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
|
||||||
parent = lo_document ).
|
parent = lo_document ).
|
||||||
|
@ -2848,7 +2851,8 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
||||||
lv_row TYPE string, " zexcel_cell_row.
|
lv_row TYPE string, " zexcel_cell_row.
|
||||||
lv_col_offset TYPE string,
|
lv_col_offset TYPE string,
|
||||||
lv_row_offset TYPE string,
|
lv_row_offset TYPE string,
|
||||||
lv_value TYPE string.
|
lv_value TYPE string,
|
||||||
|
lv_guid TYPE c LENGTH 32.
|
||||||
|
|
||||||
ls_position = io_drawing->get_position( ).
|
ls_position = io_drawing->get_position( ).
|
||||||
|
|
||||||
|
@ -2980,9 +2984,13 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
||||||
lo_element_pic->append_child( new_child = lo_element ).
|
lo_element_pic->append_child( new_child = lo_element ).
|
||||||
|
|
||||||
* blipFill
|
* blipFill
|
||||||
lv_value = ip_index.
|
"reference drawing
|
||||||
CONDENSE lv_value.
|
IF io_drawing->get_reference_guid( ) IS INITIAL.
|
||||||
CONCATENATE 'rId' lv_value INTO lv_value.
|
lv_guid = io_drawing->get_guid( ).
|
||||||
|
ELSE.
|
||||||
|
lv_guid = io_drawing->get_reference_guid( ).
|
||||||
|
ENDIF.
|
||||||
|
CONCATENATE 'rId' lv_guid INTO lv_value.
|
||||||
|
|
||||||
lo_element = io_document->create_simple_element( name = lc_xml_node_blipfill
|
lo_element = io_document->create_simple_element( name = lc_xml_node_blipfill
|
||||||
parent = io_document ).
|
parent = io_document ).
|
||||||
|
|
Loading…
Reference in New Issue
Block a user