From 1abc86ef223319c9e1e5ff415d654c9313aba9cd Mon Sep 17 00:00:00 2001 From: Ivan Femia Date: Fri, 27 May 2011 13:23:10 +0000 Subject: [PATCH] Fix issues #10 and #96 git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@187 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049 --- ZA2X/CLAS/ZCL_EXCEL_STYLE_CONDITIONAL.slnk | 162 ++++++++----- ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk | 225 ++++++++++++++----- ZA2X/DTEL/ZEXCEL_CONDITIONAL_SHOW_VALUE.slnk | 4 + ZA2X/DTEL/ZEXCEL_CONDITIONAL_TYPE.slnk | 4 + ZA2X/DTEL/ZEXCEL_CONDITIONAL_VALUE.slnk | 4 + ZA2X/PROG/ZDEMO_EXCEL.slnk | 4 +- ZA2X/PROG/ZDEMO_EXCEL10.slnk | 25 ++- ZA2X/PROG/ZDEMO_EXCEL27.slnk | 194 +++++++++++----- ZA2X/PROG/ZDEMO_EXCEL5.slnk | 41 +++- ZA2X/PROG/ZDEMO_EXCEL7.slnk | 158 ++++++++----- ZA2X/TABL/ZEXCEL_CONDITIONAL_CELLIS.slnk | 7 + ZA2X/TABL/ZEXCEL_CONDITIONAL_ICONSET.slnk | 16 ++ 12 files changed, 618 insertions(+), 226 deletions(-) create mode 100644 ZA2X/DTEL/ZEXCEL_CONDITIONAL_SHOW_VALUE.slnk create mode 100644 ZA2X/DTEL/ZEXCEL_CONDITIONAL_TYPE.slnk create mode 100644 ZA2X/DTEL/ZEXCEL_CONDITIONAL_VALUE.slnk create mode 100644 ZA2X/TABL/ZEXCEL_CONDITIONAL_CELLIS.slnk create mode 100644 ZA2X/TABL/ZEXCEL_CONDITIONAL_ICONSET.slnk diff --git a/ZA2X/CLAS/ZCL_EXCEL_STYLE_CONDITIONAL.slnk b/ZA2X/CLAS/ZCL_EXCEL_STYLE_CONDITIONAL.slnk index 4aaa95c..930f037 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_STYLE_CONDITIONAL.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_STYLE_CONDITIONAL.slnk @@ -9,6 +9,10 @@ *"* do not include other source files here!!! public section. + constants C_CFVO_TYPE_FORMULA type ZEXCEL_CONDITIONAL_TYPE value 'formula'. "#EC NOTEXT + constants C_CFVO_TYPE_NUMBER type ZEXCEL_CONDITIONAL_TYPE value 'number'. "#EC NOTEXT + constants C_CFVO_TYPE_PERCENT type ZEXCEL_CONDITIONAL_TYPE value 'percent'. "#EC NOTEXT + constants C_CFVO_TYPE_PERCENTILE type ZEXCEL_CONDITIONAL_TYPE value 'percentile'. "#EC NOTEXT constants C_ICONSET_3ARROWS type ZEXCEL_CONDITION_RULE_ICONSET value '3Arrows'. "#EC NOTEXT constants C_ICONSET_3ARROWSGRAY type ZEXCEL_CONDITION_RULE_ICONSET value '3ArrowsGray'. "#EC NOTEXT constants C_ICONSET_3FLAGS type ZEXCEL_CONDITION_RULE_ICONSET value '3Flags'. "#EC NOTEXT @@ -43,11 +47,27 @@ public section. constants C_RULE_EXPRESSION type ZEXCEL_CONDITION_RULE value 'expression'. "#EC NOTEXT constants C_RULE_ICONSET type ZEXCEL_CONDITION_RULE value 'iconSet'. "#EC NOTEXT constants C_RULE_NONE type ZEXCEL_CONDITION_RULE value 'none'. "#EC NOTEXT - data FORMULA type ZEXCEL_STYLE_FORMULA . - data ICONSET type ZEXCEL_CONDITION_RULE_ICONSET . - data OPERATOR type ZEXCEL_CONDITION_OPERATOR . + constants C_SHOWVALUE_FALSE type ZEXCEL_CONDITIONAL_SHOW_VALUE value 0. "#EC NOTEXT + constants C_SHOWVALUE_TRUE type ZEXCEL_CONDITIONAL_SHOW_VALUE value 1. "#EC NOTEXT + data MODE_CELLIS type ZEXCEL_CONDITIONAL_CELLIS . + data MODE_ICONSET type ZEXCEL_CONDITIONAL_ICONSET . data PRIORITY type ZEXCEL_STYLE_PRIORITY value 1. "#EC NOTEXT . data RULE type ZEXCEL_CONDITION_RULE . + data ZCELL_STYLE2 type ZEXCEL_CELL_STYLE . + data ZCFVO1_TYPE2 type ZEXCEL_CONDITIONAL_TYPE . + data ZCFVO1_VALUE2 type ZEXCEL_CONDITIONAL_VALUE . + data ZCFVO2_TYPE2 type ZEXCEL_CONDITIONAL_TYPE . + data ZCFVO2_VALUE2 type ZEXCEL_CONDITIONAL_VALUE . + data ZCFVO3_TYPE2 type ZEXCEL_CONDITIONAL_TYPE . + data ZCFVO3_VALUE2 type ZEXCEL_CONDITIONAL_VALUE . + data ZCFVO4_TYPE2 type ZEXCEL_CONDITIONAL_TYPE . + data ZCFVO4_VALUE2 type ZEXCEL_CONDITIONAL_VALUE . + data ZCFVO5_TYPE2 type ZEXCEL_CONDITIONAL_TYPE . + data ZCFVO5_VALUE2 type ZEXCEL_CONDITIONAL_VALUE . + data ZFORMULA2 type ZEXCEL_STYLE_FORMULA . + data ZICONSET2 type ZEXCEL_CONDITION_RULE_ICONSET . + data ZOPERATOR2 type ZEXCEL_CONDITION_OPERATOR . + data ZSHOWVALUE2 type ZEXCEL_CONDITIONAL_SHOW_VALUE . methods CONSTRUCTOR . methods GET_DIMENSION_RANGE @@ -76,57 +96,95 @@ private section. *"* implementation or private method's signature *"* use this source file for any macro definitions you need *"* in the implementation part of the class - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - method CONSTRUCTOR. - rule = me->c_rule_none. - operator = me->c_operator_none. + METHOD constructor. + + DATA: ls_iconset TYPE zexcel_conditional_iconset. + ls_iconset-iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights. + ls_iconset-cfvo1_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo1_value = '0'. + ls_iconset-cfvo2_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo2_value = '20'. + ls_iconset-cfvo3_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo3_value = '40'. + ls_iconset-cfvo4_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo4_value = '60'. + ls_iconset-cfvo5_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo5_value = '80'. + + + me->rule = zcl_excel_style_conditional=>c_rule_none. +* me->iconset->operator = zcl_excel_style_conditional=>c_operator_none. + me->mode_iconset = ls_iconset. + me->priority = 1. + * inizialize dimension range - stop_cell-cell_row = 1. - stop_cell-cell_column = 1. - start_cell-cell_row = 1. - start_cell-cell_column = 1. -endmethod. + me->stop_cell-cell_row = 1. + me->stop_cell-cell_column = 1. + me->start_cell-cell_row = 1. + me->start_cell-cell_column = 1. +ENDMETHOD. diff --git a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk index 4cf1511..776908a 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk @@ -14,13 +14,15 @@ public section. *"* protected components of class ZCL_EXCEL_WRITER_2007 *"* do not include other source files here!!! protected section. - private section. -*"* private components of class ZCL_EXCEL_WRITER_2007 + *"* private components of class ZCL_EXCEL_WRITER_2007 *"* do not include other source files here!!! +private section. constants C_CONTENT_TYPES type STRING value '[Content_Types].xml'. "#EC NOTEXT constants C_DOCPROPS_APP type STRING value 'docProps/app.xml'. "#EC NOTEXT constants C_DOCPROPS_CORE type STRING value 'docProps/core.xml'. "#EC NOTEXT + constants C_OFF type STRING value '0'. "#EC NOTEXT + constants C_ON type STRING value '1'. "#EC NOTEXT constants C_RELATIONSHIPS type STRING value '_rels/.rels'. "#EC NOTEXT constants C_XL_DRAWINGS type STRING value 'xl/drawings/drawing#.xml'. "#EC NOTEXT constants C_XL_DRAWINGS_RELS type STRING value 'xl/drawings/_rels/drawing#.xml.rels'. "#EC NOTEXT @@ -33,9 +35,8 @@ protected section. constants C_XL_WORKBOOK type STRING value 'xl/workbook.xml'. "#EC NOTEXT data EXCEL type ref to ZCL_EXCEL . data SHARED_STRINGS type ZEXCEL_T_SHARED_STRING . + data STYLES_COND_MAPPING type ZEXCEL_T_STYLES_MAPPING . data STYLES_MAPPING type ZEXCEL_T_STYLES_MAPPING . - constants C_ON type STRING value '1'. "#EC NOTEXT - constants C_OFF type STRING value '0'. "#EC NOTEXT methods CREATE returning @@ -121,21 +122,22 @@ protected section. - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + method ZIF_EXCEL_WRITER~WRITE_FILE. me->excel = io_excel. @@ -1590,6 +1592,11 @@ endmethod. METHOD create_xl_sheet. + TYPES: BEGIN OF cfvo, + value TYPE zexcel_conditional_value, + type TYPE zexcel_conditional_type, + END OF cfvo. + ** Constant node name DATA: lc_xml_node_worksheet TYPE string VALUE 'worksheet', lc_xml_node_sheetpr TYPE string VALUE 'sheetPr', @@ -1680,6 +1687,7 @@ endmethod. lc_xml_attr_footer TYPE string VALUE 'footer', lc_xml_attr_type TYPE string VALUE 'type', lc_xml_attr_iconset TYPE string VALUE 'iconSet', + lc_xml_attr_showvalue TYPE string VALUE 'showValue', lc_xml_attr_val TYPE string VALUE 'val', lc_xml_attr_dxfid TYPE string VALUE 'dxfId', lc_xml_attr_priority TYPE string VALUE 'priority', @@ -1745,8 +1753,10 @@ endmethod. lv_column TYPE zexcel_cell_column, lv_style_guid TYPE zexcel_cell_style, lv_flag TYPE c, - lt_percent_val TYPE TABLE OF string, - ls_percent_val TYPE string, + ls_iconset TYPE zexcel_conditional_iconset, + ls_cellis TYPE zexcel_conditional_cellis, + lt_cfvo TYPE TABLE OF cfvo, + ls_cfvo TYPE cfvo, lv_cell_row_s TYPE string, ls_last_row TYPE zexcel_s_cell_data, ls_style_mapping TYPE zexcel_s_styles_mapping, @@ -1755,6 +1765,7 @@ endmethod. lv_freeze_cell_column_alpha TYPE zexcel_cell_column_alpha, column_dimensions TYPE zexcel_t_worksheet_columndime, row_dimensions TYPE zexcel_t_worksheet_rowdimensio, + ls_style_cond_mapping TYPE zexcel_s_styles_mapping, lv_relation_id TYPE i VALUE 0, outline_level_row TYPE i VALUE 0, outline_level_col TYPE i VALUE 0, @@ -2292,17 +2303,25 @@ endmethod. CASE lo_style_conditional->rule. WHEN zcl_excel_style_conditional=>c_rule_iconset. - CLEAR lt_percent_val. + + ls_iconset = lo_style_conditional->mode_iconset. + + CLEAR lt_cfvo. " iconset node lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_iconset parent = lo_document ). - IF lo_style_conditional->iconset NE zcl_excel_style_conditional=>c_iconset_3trafficlights. - lv_value = lo_style_conditional->iconset. + IF ls_iconset-iconset NE zcl_excel_style_conditional=>c_iconset_3trafficlights. + lv_value = ls_iconset-iconset. lo_element_3->set_attribute_ns( name = lc_xml_attr_iconset value = lv_value ). ENDIF. - CASE lo_style_conditional->iconset. + " Set the showValue attribute + lv_value = ls_iconset-showvalue. + lo_element_3->set_attribute_ns( name = lc_xml_attr_showvalue + value = lv_value ). + + CASE ls_iconset-iconset. WHEN zcl_excel_style_conditional=>c_iconset_3trafficlights2 OR zcl_excel_style_conditional=>c_iconset_3arrows OR zcl_excel_style_conditional=>c_iconset_3arrowsgray OR @@ -2312,54 +2331,84 @@ endmethod. zcl_excel_style_conditional=>c_iconset_3symbols2 OR zcl_excel_style_conditional=>c_iconset_3trafficlights OR zcl_excel_style_conditional=>c_iconset_3trafficlights2. - APPEND '0' TO lt_percent_val. - APPEND '33' TO lt_percent_val. - APPEND '67' TO lt_percent_val. + MOVE ls_iconset-cfvo1_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo1_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. + MOVE ls_iconset-cfvo2_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo2_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. + MOVE ls_iconset-cfvo3_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo3_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. WHEN zcl_excel_style_conditional=>c_iconset_4arrows OR zcl_excel_style_conditional=>c_iconset_4arrowsgray OR zcl_excel_style_conditional=>c_iconset_4rating OR zcl_excel_style_conditional=>c_iconset_4redtoblack OR zcl_excel_style_conditional=>c_iconset_4trafficlights. - APPEND '0' TO lt_percent_val. - APPEND '25' TO lt_percent_val. - APPEND '50' TO lt_percent_val. - APPEND '75' TO lt_percent_val. + MOVE ls_iconset-cfvo1_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo1_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. + MOVE ls_iconset-cfvo2_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo2_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. + MOVE ls_iconset-cfvo3_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo3_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. + MOVE ls_iconset-cfvo4_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo4_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. WHEN zcl_excel_style_conditional=>c_iconset_5arrows OR zcl_excel_style_conditional=>c_iconset_5arrowsgray OR zcl_excel_style_conditional=>c_iconset_5quarters OR zcl_excel_style_conditional=>c_iconset_5rating. - APPEND '0' TO lt_percent_val. - APPEND '20' TO lt_percent_val. - APPEND '40' TO lt_percent_val. - APPEND '60' TO lt_percent_val. - APPEND '80' TO lt_percent_val. + MOVE ls_iconset-cfvo1_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo1_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. + MOVE ls_iconset-cfvo2_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo2_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. + MOVE ls_iconset-cfvo3_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo3_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. + MOVE ls_iconset-cfvo4_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo4_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. + MOVE ls_iconset-cfvo5_value TO ls_cfvo-value. + MOVE ls_iconset-cfvo5_type TO ls_cfvo-type. + APPEND ls_cfvo TO lt_cfvo. WHEN OTHERS. - CLEAR lt_percent_val. + CLEAR lt_cfvo. ENDCASE. - LOOP AT lt_percent_val INTO ls_percent_val. + LOOP AT lt_cfvo INTO ls_cfvo. " cfvo node lo_element_4 = lo_document->create_simple_element( name = lc_xml_node_cfvo parent = lo_document ). + lv_value = ls_cfvo-type. lo_element_4->set_attribute_ns( name = lc_xml_attr_type - value = 'percent' ). + value = lv_value ). + lv_value = ls_cfvo-value. lo_element_4->set_attribute_ns( name = lc_xml_attr_val - value = ls_percent_val ). + value = lv_value ). lo_element_3->append_child( new_child = lo_element_4 ). " cfvo node ENDLOOP. lo_element_2->append_child( new_child = lo_element_3 ). " iconset node WHEN zcl_excel_style_conditional=>c_rule_cellis. + ls_cellis = lo_style_conditional->mode_cellis. + READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY guid = ls_cellis-cell_style. + lv_value = ls_style_cond_mapping-style. + CONDENSE lv_value. lo_element_2->set_attribute_ns( name = lc_xml_attr_dxfid - value = '0' ). " @TODO <***************************** - lv_value = lo_style_conditional->operator. + value = lv_value ). + lv_value = ls_cellis-operator. lo_element_2->set_attribute_ns( name = lc_xml_attr_operator value = lv_value ). " formula node lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_formula parent = lo_document ). - lv_value = lo_style_conditional->formula. + lv_value = ls_cellis-formula. lo_element_3->set_value( value = lv_value ). lo_element_2->append_child( new_child = lo_element_3 ). " formula node @@ -2906,7 +2955,7 @@ endmethod. - method CREATE_XL_STYLES. + METHOD create_xl_styles. ** Constant node name @@ -2949,6 +2998,7 @@ endmethod. lc_xml_node_cellstyles TYPE string VALUE 'cellStyles', lc_xml_node_cellstyle TYPE string VALUE 'cellStyle', lc_xml_node_dxfs TYPE string VALUE 'dxfs', + lc_xml_node_dxf TYPE string VALUE 'dxf', lc_xml_node_tablestyles TYPE string VALUE 'tableStyles', " Colors lc_xml_node_colors TYPE string VALUE 'colors', @@ -2992,8 +3042,8 @@ endmethod. lc_xml_attr_indent TYPE string VALUE 'indent', lc_xml_attr_locked TYPE string VALUE 'locked', lc_xml_attr_hidden TYPE string VALUE 'hidden', - lc_xml_attr_diagonalUp TYPE string VALUE 'diagonalUp', - lc_xml_attr_diagonalDown TYPE string VALUE 'diagonalDown', + lc_xml_attr_diagonalup TYPE string VALUE 'diagonalUp', + lc_xml_attr_diagonaldown TYPE string VALUE 'diagonalDown', " Node namespace lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'. @@ -3017,6 +3067,9 @@ endmethod. lo_ostream TYPE REF TO if_ixml_ostream, lo_renderer TYPE REF TO if_ixml_renderer, lo_iterator TYPE REF TO cl_object_collection_iterator, + lo_iterator2 TYPE REF TO cl_object_collection_iterator, + lo_worksheet TYPE REF TO zcl_excel_worksheet, + lo_style_conditional TYPE REF TO zcl_excel_style_conditional, lo_style TYPE REF TO zcl_excel_style. @@ -3034,9 +3087,12 @@ endmethod. ls_alignment TYPE zexcel_s_style_alignment, lt_cellxfs TYPE zexcel_t_cellxfs, ls_cellxfs TYPE zexcel_s_cellxfs, - ls_styles_mapping TYPE zexcel_s_styles_mapping. + ls_styles_mapping TYPE zexcel_s_styles_mapping, + ls_style_cond_mapping TYPE zexcel_s_styles_mapping, + ls_cellis TYPE zexcel_conditional_cellis. DATA: lv_value TYPE string, + lv_dfx_count TYPE i, lv_fonts_count TYPE i, lv_fills_count TYPE i, lv_borders_count TYPE i, @@ -3615,8 +3671,77 @@ endmethod. " dxfs node lo_element = lo_document->create_simple_element( name = lc_xml_node_dxfs parent = lo_document ). + + lo_iterator = me->excel->get_worksheets_iterator( ). + " get sheets + WHILE lo_iterator->if_object_collection_iterator~has_next( ) EQ abap_true. + lo_worksheet ?= lo_iterator->if_object_collection_iterator~get_next( ). + " Conditional formatting styles into exch sheet + lo_iterator2 = lo_worksheet->get_cond_styles_iterator( ). + WHILE lo_iterator2->if_object_collection_iterator~has_next( ) EQ abap_true. + lo_style_conditional ?= lo_iterator2->if_object_collection_iterator~get_next( ). + CASE lo_style_conditional->rule. + WHEN zcl_excel_style_conditional=>c_rule_cellis. + "if style defined + ls_cellis = lo_style_conditional->mode_cellis. + IF ls_cellis-cell_style IS INITIAL. + CONTINUE. + ENDIF. + READ TABLE me->styles_mapping INTO ls_styles_mapping WITH KEY guid = ls_cellis-cell_style. + ADD 1 TO ls_styles_mapping-style. " the numbering starts from 0 + READ TABLE lt_cellxfs INTO ls_cellxfs INDEX ls_styles_mapping-style. + ADD 1 TO ls_cellxfs-fillid. " the numbering starts from 0 + + ls_style_cond_mapping-guid = ls_cellis-cell_style. + ls_style_cond_mapping-style = lv_dfx_count. + APPEND ls_style_cond_mapping TO me->styles_cond_mapping. + ADD 1 TO lv_dfx_count. + + " dxf node + lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_dxf + parent = lo_document ). + + READ TABLE lt_fills INTO ls_fill INDEX ls_cellxfs-fillid. + IF ls_fill IS NOT INITIAL. + " fill properties + lo_element_fill = lo_document->create_simple_element( name = lc_xml_node_fill + parent = lo_document ). + "pattern + lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_patternfill + parent = lo_document ). + lv_value = ls_fill-filltype. + lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_patterntype + value = lv_value ). + " fgcolor + create_xl_styles_color_node( + io_document = lo_document + io_parent = lo_sub_element_2 + is_color = ls_fill-fgcolor + iv_color_elem_name = lc_xml_node_fgcolor ). + + " bgcolor + create_xl_styles_color_node( + io_document = lo_document + io_parent = lo_sub_element_2 + is_color = ls_fill-bgcolor + iv_color_elem_name = lc_xml_node_bgcolor ). + + lo_element_fill->append_child( new_child = lo_sub_element_2 ). "pattern + + lo_sub_element->append_child( new_child = lo_element_fill ). + ENDIF. + + lo_element->append_child( new_child = lo_sub_element ). + WHEN OTHERS. + CONTINUE. + ENDCASE. + ENDWHILE. + ENDWHILE. + + lv_value = lv_dfx_count. + CONDENSE lv_value. lo_element->set_attribute_ns( name = lc_xml_attr_count - value = '0' ). + value = lv_value ). lo_element_root->append_child( new_child = lo_element ). " tableStyles node @@ -3637,7 +3762,7 @@ endmethod. lo_renderer = lo_ixml->create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer->render( ). -endmethod. +ENDMETHOD. diff --git a/ZA2X/DTEL/ZEXCEL_CONDITIONAL_SHOW_VALUE.slnk b/ZA2X/DTEL/ZEXCEL_CONDITIONAL_SHOW_VALUE.slnk new file mode 100644 index 0000000..61066b9 --- /dev/null +++ b/ZA2X/DTEL/ZEXCEL_CONDITIONAL_SHOW_VALUE.slnk @@ -0,0 +1,4 @@ + + + + diff --git a/ZA2X/DTEL/ZEXCEL_CONDITIONAL_TYPE.slnk b/ZA2X/DTEL/ZEXCEL_CONDITIONAL_TYPE.slnk new file mode 100644 index 0000000..e5b2908 --- /dev/null +++ b/ZA2X/DTEL/ZEXCEL_CONDITIONAL_TYPE.slnk @@ -0,0 +1,4 @@ + + + + diff --git a/ZA2X/DTEL/ZEXCEL_CONDITIONAL_VALUE.slnk b/ZA2X/DTEL/ZEXCEL_CONDITIONAL_VALUE.slnk new file mode 100644 index 0000000..31498da --- /dev/null +++ b/ZA2X/DTEL/ZEXCEL_CONDITIONAL_VALUE.slnk @@ -0,0 +1,4 @@ + + + + diff --git a/ZA2X/PROG/ZDEMO_EXCEL.slnk b/ZA2X/PROG/ZDEMO_EXCEL.slnk index 5056725..0aa9c59 100644 --- a/ZA2X/PROG/ZDEMO_EXCEL.slnk +++ b/ZA2X/PROG/ZDEMO_EXCEL.slnk @@ -1,5 +1,5 @@ - + @@ -63,6 +63,6 @@ START-OF-SELECTION. SUBMIT zdemo_excel24 WITH p_path = p_path AND RETURN. " abap2xlsx Demo: Multiple sheets with different default date formats SUBMIT zdemo_excel25 AND RETURN. " abap2xlsx Demo: Create and xlsx on Application Server (could be executed in batch mode) SUBMIT zdemo_excel26 WITH p_path = p_path AND RETURN. " abap2xlsx Demo: Reader demo -* SUBMIT zdemo_excel27 WITH p_path = p_path AND RETURN. " abap2xlsx Demo: empty + SUBMIT zdemo_excel27 WITH p_path = p_path AND RETURN. " abap2xlsx Demo: Conditional Formatting SUBMIT zdemo_excel28 WITH p_path = p_path AND RETURN. " abap2xlsx Demo: Read style format diff --git a/ZA2X/PROG/ZDEMO_EXCEL10.slnk b/ZA2X/PROG/ZDEMO_EXCEL10.slnk index 63353c6..88e33ab 100644 --- a/ZA2X/PROG/ZDEMO_EXCEL10.slnk +++ b/ZA2X/PROG/ZDEMO_EXCEL10.slnk @@ -1,12 +1,11 @@ - + - *&---------------------------------------------------------------------* *& Report ZDEMO_EXCEL10 *& @@ -24,7 +23,8 @@ DATA: lo_excel TYPE REF TO zcl_excel, column_dimension TYPE REF TO zcl_excel_worksheet_columndime. DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog, - ls_table_settings TYPE zexcel_s_table_settings. + ls_table_settings TYPE zexcel_s_table_settings, + ls_iconset TYPE zexcel_conditional_iconset. DATA: lv_file TYPE xstring, lv_bytecount TYPE i, @@ -67,11 +67,24 @@ START-OF-SELECTION. lo_worksheet = lo_excel->get_active_worksheet( ). lo_worksheet->set_title( 'Internal table' ). + ls_iconset-iconset = zcl_excel_style_conditional=>c_iconset_5arrows. + ls_iconset-cfvo1_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo1_value = '0'. + ls_iconset-cfvo2_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo2_value = '20'. + ls_iconset-cfvo3_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo3_value = '40'. + ls_iconset-cfvo4_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo4_value = '60'. + ls_iconset-cfvo5_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo5_value = '80'. + ls_iconset-showvalue = zcl_excel_style_conditional=>c_showvalue_true. + "Conditional style lo_style_conditional2 = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional2->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional2->iconset = zcl_excel_style_conditional=>c_iconset_5arrows. - lo_style_conditional2->priority = 1. + lo_style_conditional2->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional2->mode_iconset = ls_iconset. + lo_style_conditional2->priority = 1. DATA lt_test TYPE TABLE OF sflight. SELECT * FROM sflight INTO TABLE lt_test. "#EC CI_NOWHERE diff --git a/ZA2X/PROG/ZDEMO_EXCEL27.slnk b/ZA2X/PROG/ZDEMO_EXCEL27.slnk index 54258a0..25346e7 100644 --- a/ZA2X/PROG/ZDEMO_EXCEL27.slnk +++ b/ZA2X/PROG/ZDEMO_EXCEL27.slnk @@ -1,8 +1,8 @@ - + - + @@ -16,60 +16,138 @@ *&---------------------------------------------------------------------* REPORT zdemo_excel27. -* -*DATA: lo_excel TYPE REF TO zcl_excel, -* lo_excel_writer TYPE REF TO zif_excel_writer, -* lo_excel_reader TYPE REF TO zif_excel_reader. -* -*DATA: lv_file TYPE xstring, -* lv_bytecount TYPE i, -* lt_file_tab TYPE solix_tab. -* -*DATA: lv_full_path TYPE string, -* lv_workdir TYPE string, -* lv_file_separator TYPE c. -* -*CONSTANTS: lv_default_file_name TYPE string VALUE '27_Styles.xlsx'. -* -*PARAMETERS: p_path TYPE zexcel_export_dir. -* -*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path. -* lv_workdir = p_path. -* cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = lv_workdir -* CHANGING selected_folder = lv_workdir ). -* p_path = lv_workdir. -* -*INITIALIZATION. -* cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ). -* cl_gui_cfw=>flush( ). -* p_path = lv_workdir. -* -*START-OF-SELECTION. -* -* IF p_path IS INITIAL. -* p_path = lv_workdir. -* ENDIF. -* cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ). -* CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path. -* -* CREATE OBJECT lo_excel_reader TYPE zcl_excel_reader_2007. -* CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. -* lo_excel = lo_excel_reader->load_file( lv_full_path ). -* lv_file = lo_excel_writer->write_file( lo_excel ). -* REPLACE '.xlsx' IN lv_full_path WITH 'FromReader.xlsx'. -* -* " Convert to binary -* CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' -* EXPORTING -* buffer = lv_file -* IMPORTING -* output_length = lv_bytecount -* TABLES -* binary_tab = lt_file_tab. -* -* " Save the file -* cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount -* filename = lv_full_path -* filetype = 'BIN' -* CHANGING data_tab = lt_file_tab ). + +CONSTANTS: c_fish TYPE string VALUE 'Fish'. + +DATA: lo_excel TYPE REF TO zcl_excel, + lo_excel_writer TYPE REF TO zif_excel_writer, + lo_worksheet TYPE REF TO zcl_excel_worksheet, + lo_range TYPE REF TO zcl_excel_range, + lo_data_validation TYPE REF TO zcl_excel_data_validation, + lo_style_conditional TYPE REF TO zcl_excel_style_conditional, + lo_style_1 TYPE REF TO zcl_excel_style, + lo_style_2 TYPE REF TO zcl_excel_style, + lv_style_1_guid TYPE zexcel_cell_style, + lv_style_2_guid TYPE zexcel_cell_style, + ls_cellis TYPE zexcel_conditional_cellis. + +DATA: lv_file TYPE xstring, + lv_bytecount TYPE i, + lt_file_tab TYPE solix_tab. + +DATA: lv_full_path TYPE string, + lv_workdir TYPE string, + lv_title TYPE zexcel_sheet_title, + lv_file_separator TYPE c. + +CONSTANTS: lv_default_file_name TYPE string VALUE '27_ConditionalFormatting.xlsx'. + +PARAMETERS: p_path TYPE zexcel_export_dir. + +AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path. + lv_workdir = p_path. + cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = lv_workdir + CHANGING selected_folder = lv_workdir ). + p_path = lv_workdir. + +INITIALIZATION. + cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ). + cl_gui_cfw=>flush( ). + p_path = lv_workdir. + +START-OF-SELECTION. + + IF p_path IS INITIAL. + p_path = lv_workdir. + ENDIF. + cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ). + CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path. + + " Creates active sheet + CREATE OBJECT lo_excel. + + lo_style_1 = lo_excel->add_new_style( ). + lo_style_1->fill->filltype = zcl_excel_style_fill=>c_fill_solid. + lo_style_1->fill->bgcolor-rgb = zcl_excel_style_color=>c_green. + lv_style_1_guid = lo_style_1->get_guid( ). + + lo_style_2 = lo_excel->add_new_style( ). + lo_style_2->fill->filltype = zcl_excel_style_fill=>c_fill_solid. + lo_style_2->fill->bgcolor-rgb = zcl_excel_style_color=>c_red. + lv_style_2_guid = lo_style_2->get_guid( ). + + " Get active sheet + lo_worksheet = lo_excel->get_active_worksheet( ). + lv_title = 'Data Validation'. + lo_worksheet->set_title( lv_title ). + " Set values for dropdown + lo_worksheet->set_cell( ip_row = 2 ip_column = 'A' ip_value = c_fish ). + lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 'Anchovy' ). + lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = 'Carp' ). + lo_worksheet->set_cell( ip_row = 6 ip_column = 'A' ip_value = 'Catfish' ). + lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 'Cod' ). + lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 'Eel' ). + lo_worksheet->set_cell( ip_row = 9 ip_column = 'A' ip_value = 'Haddock' ). + + lo_range = lo_excel->add_new_range( ). + lo_range->name = c_fish. + lo_range->set_value( ip_sheet_name = lv_title + ip_start_column = 'A' + ip_start_row = 4 + ip_stop_column = 'A' + ip_stop_row = 9 ). + + " 1st validation + lo_data_validation = lo_worksheet->add_new_data_validation( ). + lo_data_validation->type = zcl_excel_data_validation=>c_type_list. + lo_data_validation->formula1 = c_fish. + lo_data_validation->cell_row = 2. + lo_data_validation->cell_column = 'C'. + lo_worksheet->set_cell( ip_row = 2 ip_column = 'C' ip_value = 'Select a value' ). + + lo_style_conditional = lo_worksheet->add_new_conditional_style( ). + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_cellis. + ls_cellis-formula = '"Anchovy"'. + ls_cellis-operator = zcl_excel_style_conditional=>c_operator_equal. + ls_cellis-cell_style = lv_style_1_guid. + lo_style_conditional->mode_cellis = ls_cellis. + lo_style_conditional->priority = 1. + lo_style_conditional->set_range( ip_start_column = 'C' + ip_start_row = 2 + ip_stop_column = 'C' + ip_stop_row = 2 ). + + lo_style_conditional = lo_worksheet->add_new_conditional_style( ). + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_cellis. + ls_cellis-formula = '"Carp"'. + ls_cellis-operator = zcl_excel_style_conditional=>c_operator_equal. + ls_cellis-cell_style = lv_style_2_guid. + lo_style_conditional->mode_cellis = ls_cellis. + lo_style_conditional->priority = 2. + lo_style_conditional->set_range( ip_start_column = 'C' + ip_start_row = 2 + ip_stop_column = 'C' + ip_stop_row = 2 ). + + + CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. + lv_file = lo_excel_writer->write_file( lo_excel ). + + " Convert to binary + CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' + EXPORTING + buffer = lv_file + IMPORTING + output_length = lv_bytecount + TABLES + binary_tab = lt_file_tab. +* " This method is only available on AS ABAP > 6.40 +* lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). +* lv_bytecount = xstrlen( lv_file ). + + " Save the file + cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount + filename = lv_full_path + filetype = 'BIN' + CHANGING data_tab = lt_file_tab ). diff --git a/ZA2X/PROG/ZDEMO_EXCEL5.slnk b/ZA2X/PROG/ZDEMO_EXCEL5.slnk index c6f4f29..7289e37 100644 --- a/ZA2X/PROG/ZDEMO_EXCEL5.slnk +++ b/ZA2X/PROG/ZDEMO_EXCEL5.slnk @@ -1,11 +1,10 @@ - + - *&---------------------------------------------------------------------* *& Report ZDEMO_EXCEL5 *& @@ -21,6 +20,8 @@ DATA: lo_excel TYPE REF TO zcl_excel, lo_worksheet TYPE REF TO zcl_excel_worksheet, lo_style_conditional TYPE REF TO zcl_excel_style_conditional. +DATA: ls_iconset TYPE zexcel_conditional_iconset. + DATA: lv_file TYPE xstring, lv_bytecount TYPE i, lt_file_tab TYPE solix_tab. @@ -58,9 +59,20 @@ START-OF-SELECTION. lo_worksheet = lo_excel->get_active_worksheet( ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights2. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + + + ls_iconset-iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights2. + ls_iconset-cfvo1_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo1_value = '0'. + ls_iconset-cfvo2_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo2_value = '33'. + ls_iconset-cfvo3_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset-cfvo3_value = '66'. + ls_iconset-showvalue = zcl_excel_style_conditional=>c_showvalue_true. + + lo_style_conditional->mode_iconset = ls_iconset. lo_style_conditional->set_range( ip_start_column = 'C' ip_start_row = 4 ip_stop_column = 'C' @@ -73,6 +85,25 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 500 ). + + lo_style_conditional = lo_worksheet->add_new_conditional_style( ). + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset-iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights2. + ls_iconset-showvalue = zcl_excel_style_conditional=>c_showvalue_false. + lo_style_conditional->mode_iconset = ls_iconset. + lo_style_conditional->set_range( ip_start_column = 'E' + ip_start_row = 4 + ip_stop_column = 'E' + ip_stop_row = 8 ). + + + lo_worksheet->set_cell( ip_row = 4 ip_column = 'E' ip_value = 100 ). + lo_worksheet->set_cell( ip_row = 5 ip_column = 'E' ip_value = 1000 ). + lo_worksheet->set_cell( ip_row = 6 ip_column = 'E' ip_value = 150 ). + lo_worksheet->set_cell( ip_row = 7 ip_column = 'E' ip_value = 10 ). + lo_worksheet->set_cell( ip_row = 8 ip_column = 'E' ip_value = 500 ). + CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. lv_file = lo_excel_writer->write_file( lo_excel ). diff --git a/ZA2X/PROG/ZDEMO_EXCEL7.slnk b/ZA2X/PROG/ZDEMO_EXCEL7.slnk index e0ae66d..ec3d567 100644 --- a/ZA2X/PROG/ZDEMO_EXCEL7.slnk +++ b/ZA2X/PROG/ZDEMO_EXCEL7.slnk @@ -1,12 +1,11 @@ - + - *&---------------------------------------------------------------------* *& Report ZDEMO_EXCEL7 *& @@ -22,6 +21,10 @@ DATA: lo_excel TYPE REF TO zcl_excel, lo_worksheet TYPE REF TO zcl_excel_worksheet, lo_style_conditional TYPE REF TO zcl_excel_style_conditional. +DATA: ls_iconset3 TYPE zexcel_conditional_iconset, + ls_iconset4 TYPE zexcel_conditional_iconset, + ls_iconset5 TYPE zexcel_conditional_iconset. + DATA: lv_file TYPE xstring, lv_bytecount TYPE i, lt_file_tab TYPE solix_tab. @@ -55,13 +58,46 @@ START-OF-SELECTION. CREATE OBJECT lo_excel. + ls_iconset3-cfvo1_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset3-cfvo1_value = '0'. + ls_iconset3-cfvo2_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset3-cfvo2_value = '33'. + ls_iconset3-cfvo3_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset3-cfvo3_value = '66'. + ls_iconset3-showvalue = zcl_excel_style_conditional=>c_showvalue_true. + + ls_iconset4-cfvo1_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset4-cfvo1_value = '0'. + ls_iconset4-cfvo2_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset4-cfvo2_value = '25'. + ls_iconset4-cfvo3_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset4-cfvo3_value = '50'. + ls_iconset4-cfvo4_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset4-cfvo4_value = '75'. + ls_iconset4-showvalue = zcl_excel_style_conditional=>c_showvalue_true. + + ls_iconset5-cfvo1_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset5-cfvo1_value = '0'. + ls_iconset5-cfvo2_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset5-cfvo2_value = '20'. + ls_iconset5-cfvo3_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset5-cfvo3_value = '40'. + ls_iconset5-cfvo4_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset5-cfvo4_value = '60'. + ls_iconset5-cfvo5_type = zcl_excel_style_conditional=>c_cfvo_type_percent. + ls_iconset5-cfvo5_value = '80'. + ls_iconset5-showvalue = zcl_excel_style_conditional=>c_showvalue_true. + " Get active sheet lo_worksheet = lo_excel->get_active_worksheet( ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3arrows. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + + ls_iconset3-iconset = zcl_excel_style_conditional=>c_iconset_3arrows. + + lo_style_conditional->mode_iconset = ls_iconset3. lo_style_conditional->set_range( ip_start_column = 'B' ip_start_row = 5 ip_stop_column = 'B' @@ -75,9 +111,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 9 ip_column = 'B' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3arrowsgray. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset3-iconset = zcl_excel_style_conditional=>c_iconset_3arrowsgray. + lo_style_conditional->mode_iconset = ls_iconset3. lo_style_conditional->set_range( ip_start_column = 'C' ip_start_row = 5 ip_stop_column = 'C' @@ -90,9 +127,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'C' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3flags. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset3-iconset = zcl_excel_style_conditional=>c_iconset_3flags. + lo_style_conditional->mode_iconset = ls_iconset3. lo_style_conditional->set_range( ip_start_column = 'D' ip_start_row = 5 ip_stop_column = 'D' @@ -106,9 +144,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 9 ip_column = 'D' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset3-iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights. + lo_style_conditional->mode_iconset = ls_iconset3. lo_style_conditional->set_range( ip_start_column = 'E' ip_start_row = 5 ip_stop_column = 'E' @@ -122,9 +161,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 9 ip_column = 'E' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights2. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset3-iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights2. + lo_style_conditional->mode_iconset = ls_iconset3. lo_style_conditional->set_range( ip_start_column = 'F' ip_start_row = 5 ip_stop_column = 'F' @@ -138,9 +178,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 9 ip_column = 'F' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3signs. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset3-iconset = zcl_excel_style_conditional=>c_iconset_3signs. + lo_style_conditional->mode_iconset = ls_iconset3. lo_style_conditional->set_range( ip_start_column = 'G' ip_start_row = 5 ip_stop_column = 'G' @@ -154,9 +195,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 9 ip_column = 'G' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3symbols. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset3-iconset = zcl_excel_style_conditional=>c_iconset_3symbols. + lo_style_conditional->mode_iconset = ls_iconset3. lo_style_conditional->set_range( ip_start_column = 'H' ip_start_row = 5 ip_stop_column = 'H' @@ -170,9 +212,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 9 ip_column = 'H' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3symbols2. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset3-iconset = zcl_excel_style_conditional=>c_iconset_3symbols2. + lo_style_conditional->mode_iconset = ls_iconset3. lo_style_conditional->set_range( ip_start_column = 'I' ip_start_row = 5 ip_stop_column = 'I' @@ -186,9 +229,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 9 ip_column = 'I' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4arrows. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset4-iconset = zcl_excel_style_conditional=>c_iconset_4arrows. + lo_style_conditional->mode_iconset = ls_iconset4. lo_style_conditional->set_range( ip_start_column = 'B' ip_start_row = 12 ip_stop_column = 'B' @@ -202,9 +246,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 16 ip_column = 'B' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4arrowsgray. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset4-iconset = zcl_excel_style_conditional=>c_iconset_4arrowsgray. + lo_style_conditional->mode_iconset = ls_iconset4. lo_style_conditional->set_range( ip_start_column = 'C' ip_start_row = 12 ip_stop_column = 'C' @@ -218,9 +263,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 16 ip_column = 'C' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4redtoblack. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset4-iconset = zcl_excel_style_conditional=>c_iconset_4redtoblack. + lo_style_conditional->mode_iconset = ls_iconset4. lo_style_conditional->set_range( ip_start_column = 'D' ip_start_row = 12 ip_stop_column = 'D' @@ -234,9 +280,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 16 ip_column = 'D' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4rating. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset4-iconset = zcl_excel_style_conditional=>c_iconset_4rating. + lo_style_conditional->mode_iconset = ls_iconset4. lo_style_conditional->set_range( ip_start_column = 'E' ip_start_row = 12 ip_stop_column = 'E' @@ -250,9 +297,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 16 ip_column = 'E' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4trafficlights. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset4-iconset = zcl_excel_style_conditional=>c_iconset_4trafficlights. + lo_style_conditional->mode_iconset = ls_iconset4. lo_style_conditional->set_range( ip_start_column = 'F' ip_start_row = 12 ip_stop_column = 'F' @@ -266,9 +314,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 16 ip_column = 'F' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_5arrows. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset5-iconset = zcl_excel_style_conditional=>c_iconset_5arrows. + lo_style_conditional->mode_iconset = ls_iconset5. lo_style_conditional->set_range( ip_start_column = 'B' ip_start_row = 19 ip_stop_column = 'B' @@ -282,9 +331,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 23 ip_column = 'B' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_5arrowsgray. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset5-iconset = zcl_excel_style_conditional=>c_iconset_5arrowsgray. + lo_style_conditional->mode_iconset = ls_iconset5. lo_style_conditional->set_range( ip_start_column = 'C' ip_start_row = 19 ip_stop_column = 'C' @@ -298,9 +348,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 23 ip_column = 'C' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_5rating. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset5-iconset = zcl_excel_style_conditional=>c_iconset_5rating. + lo_style_conditional->mode_iconset = ls_iconset5. lo_style_conditional->set_range( ip_start_column = 'D' ip_start_row = 19 ip_stop_column = 'D' @@ -314,9 +365,10 @@ START-OF-SELECTION. lo_worksheet->set_cell( ip_row = 23 ip_column = 'D' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). - lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. - lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_5quarters. - lo_style_conditional->priority = 1. + lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. + lo_style_conditional->priority = 1. + ls_iconset5-iconset = zcl_excel_style_conditional=>c_iconset_5quarters. + lo_style_conditional->mode_iconset = ls_iconset5. lo_style_conditional->set_range( ip_start_column = 'E' ip_start_row = 19 ip_stop_column = 'E' diff --git a/ZA2X/TABL/ZEXCEL_CONDITIONAL_CELLIS.slnk b/ZA2X/TABL/ZEXCEL_CONDITIONAL_CELLIS.slnk new file mode 100644 index 0000000..94f84bd --- /dev/null +++ b/ZA2X/TABL/ZEXCEL_CONDITIONAL_CELLIS.slnk @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ZA2X/TABL/ZEXCEL_CONDITIONAL_ICONSET.slnk b/ZA2X/TABL/ZEXCEL_CONDITIONAL_ICONSET.slnk new file mode 100644 index 0000000..c87301e --- /dev/null +++ b/ZA2X/TABL/ZEXCEL_CONDITIONAL_ICONSET.slnk @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + +