mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 16:36:12 +08:00
Update zcl_excel_converter.clas.abap
This commit is contained in:
parent
16fac218f7
commit
2b83b2c027
|
@ -133,14 +133,14 @@ CLASS zcl_excel_converter DEFINITION
|
||||||
RAISING
|
RAISING
|
||||||
zcx_excel .
|
zcx_excel .
|
||||||
METHODS clean_fieldcatalog .
|
METHODS clean_fieldcatalog .
|
||||||
methods COMPLETE_CELL
|
METHODS complete_cell
|
||||||
importing
|
IMPORTING
|
||||||
!IP_TABLE_ROW type ZEXCEL_CELL_ROW
|
!ip_table_row TYPE zexcel_cell_row
|
||||||
!IP_FIELDNAME type FIELDNAME
|
!ip_fieldname TYPE fieldname
|
||||||
!IP_COLUMN type SIMPLE
|
!ip_column TYPE simple
|
||||||
!IP_ROW type ZEXCEL_CELL_ROW
|
!ip_row TYPE zexcel_cell_row
|
||||||
raising
|
RAISING
|
||||||
ZCX_EXCEL .
|
zcx_excel .
|
||||||
METHODS create_formular_subtotal
|
METHODS create_formular_subtotal
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!i_row_int_start TYPE zexcel_cell_row
|
!i_row_int_start TYPE zexcel_cell_row
|
||||||
|
@ -351,7 +351,7 @@ CLASS zcl_excel_converter IMPLEMENTATION.
|
||||||
lv_line TYPE i.
|
lv_line TYPE i.
|
||||||
|
|
||||||
FIELD-SYMBOLS: <fs_tab> TYPE ANY TABLE,
|
FIELD-SYMBOLS: <fs_tab> TYPE ANY TABLE,
|
||||||
<fs_stab> TYPE ANY.
|
<fs_stab> TYPE any.
|
||||||
|
|
||||||
ASSIGN wo_data->* TO <fs_tab> .
|
ASSIGN wo_data->* TO <fs_tab> .
|
||||||
|
|
||||||
|
@ -530,19 +530,9 @@ CLASS zcl_excel_converter IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD complete_cell.
|
METHOD complete_cell.
|
||||||
|
|
||||||
|
DATA: ls_colors TYPE zexcel_s_converter_col.
|
||||||
|
|
||||||
* Now let's check for colors
|
* Now let's check for colors
|
||||||
DATA: ls_color TYPE zexcel_s_style_color,
|
|
||||||
ls_colors TYPE zexcel_s_converter_col,
|
|
||||||
ls_colors_col LIKE ls_colors,
|
|
||||||
ls_fieldcat LIKE LINE OF wt_fieldcatalog,
|
|
||||||
lv_subrc TYPE sy-subrc.
|
|
||||||
|
|
||||||
READ TABLE wt_fieldcatalog INTO ls_fieldcat WITH KEY columnname = ip_fieldname.
|
|
||||||
|
|
||||||
* Gemäss ALV-Logik gilt: Farbe am Feld hat immer oberste Priorität. Sonst gilt:
|
|
||||||
* Bei Schlüssel-Feldern übersteuert die Spaltenfarbe (dann hellblau) die Zeilenfarbe,
|
|
||||||
* ausser dies wird durch NOKEYCOL an der Zeile explizit verboten.
|
|
||||||
* Dann gilt hier wie sonst auch: Zeilenfarbe vor Spaltenfarbe.
|
|
||||||
IF NOT wt_colors IS INITIAL.
|
IF NOT wt_colors IS INITIAL.
|
||||||
* Field has color
|
* Field has color
|
||||||
READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row
|
READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row
|
||||||
|
@ -551,31 +541,17 @@ CLASS zcl_excel_converter IMPLEMENTATION.
|
||||||
* Full line has color
|
* Full line has color
|
||||||
READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row
|
READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row
|
||||||
columnname = space.
|
columnname = space.
|
||||||
IF sy-subrc <> 0 OR ls_colors-nokeycol IS INITIAL.
|
|
||||||
lv_subrc = sy-subrc.
|
|
||||||
* Fieldcatalog/Column has color
|
|
||||||
READ TABLE wt_colors INTO ls_colors_col WITH KEY rownumber = 0
|
|
||||||
columnname = ip_fieldname.
|
|
||||||
IF sy-subrc = 0 AND
|
|
||||||
( NOT ls_fieldcat-keyflag IS INITIAL OR "Use key color found
|
|
||||||
lv_subrc <> 0 ). "Use column color if no line color was found
|
|
||||||
ls_colors = ls_colors_col.
|
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ENDIF.
|
IF sy-subrc = 0.
|
||||||
ENDIF.
|
|
||||||
IF NOT ls_colors IS INITIAL.
|
|
||||||
ls_color-rgb = zcl_excel_style_color=>c_gray.
|
|
||||||
ls_color-indexed = zcl_excel_style_color=>c_indexed_not_set.
|
|
||||||
ls_color-theme = zcl_excel_style_color=>c_theme_not_set.
|
|
||||||
wo_worksheet->change_cell_style( ip_column = ip_column
|
wo_worksheet->change_cell_style( ip_column = ip_column
|
||||||
ip_row = ip_row
|
ip_row = ip_row
|
||||||
ip_font_color_rgb = ls_colors-fontcolor
|
ip_font_color_rgb = ls_colors-fontcolor
|
||||||
ip_fill_filltype = zcl_excel_style_fill=>c_fill_solid
|
ip_fill_filltype = zcl_excel_style_fill=>c_fill_solid
|
||||||
ip_fill_fgcolor_rgb = ls_colors-fillcolor
|
ip_fill_fgcolor_rgb = ls_colors-fillcolor ).
|
||||||
ip_borders_allborders_style = zcl_excel_style_border=>c_border_thin
|
|
||||||
ip_borders_allborders_color = ls_color ).
|
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
|
* todo: hyperlink support
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user