*"* local class implementation for public class
*"* use this source file for the implementation part of
*"* local helper classes*"* use this source file for any type declarations (class
*"* definitions, interfaces or data types) you need for method
*"* implementation or private method's signature*"* use this source file for any macro definitions you need
*"* in the implementation part of the classMETHOD add_range.
DATA: lv_column TYPE zexcel_cell_column,
lv_row_alpha TYPE string,
lv_col_alpha TYPE string,
lv_coords1 TYPE string,
lv_coords2 TYPE string.
lv_column = zcl_excel_common=>convert_column2int( ip_start_column ).
* me->mv_cell_data-cell_row = 1.
* me->mv_cell_data-cell_column = lv_column.
*
lv_col_alpha = ip_start_column.
lv_row_alpha = ip_start_row.
SHIFT lv_row_alpha RIGHT DELETING TRAILING space.
SHIFT lv_row_alpha LEFT DELETING LEADING space.
CONCATENATE lv_col_alpha lv_row_alpha INTO lv_coords1.
IF ip_stop_column IS NOT INITIAL.
lv_column = zcl_excel_common=>convert_column2int( ip_stop_column ).
ELSE.
lv_column = zcl_excel_common=>convert_column2int( ip_start_column ).
ENDIF.
IF ip_stop_row IS NOT INITIAL. " If we don't get explicitly a stop column use start column
lv_row_alpha = ip_stop_row.
ELSE.
lv_row_alpha = ip_start_row.
ENDIF.
IF ip_stop_column IS NOT INITIAL. " If we don't get explicitly a stop column use start column
lv_col_alpha = ip_stop_column.
ELSE.
lv_col_alpha = ip_start_column.
ENDIF.
SHIFT lv_row_alpha RIGHT DELETING TRAILING space.
SHIFT lv_row_alpha LEFT DELETING LEADING space.
CONCATENATE lv_col_alpha lv_row_alpha INTO lv_coords2.
IF lv_coords2 IS NOT INITIAL AND lv_coords2 <> lv_coords1.
CONCATENATE me->mv_rule_range ` ` lv_coords1 ':' lv_coords2 INTO me->mv_rule_range.
ELSE.
CONCATENATE me->mv_rule_range ` ` lv_coords1 INTO me->mv_rule_range.
ENDIF.
SHIFT me->mv_rule_range LEFT DELETING LEADING space.
ENDMETHOD.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
me->MV_RULE_RANGE = 'A1'.
ENDMETHOD.METHOD factory_cond_style_iconset.
*--------------------------------------------------------------------*
* Work in progress
* Missing: LE or LT may be specified --> extend structure ZEXCEL_CONDITIONAL_ICONSET to hold this information as well
*--------------------------------------------------------------------*
* DATA: lv_needed_values TYPE i.
* CASE icon_type.
*
* WHEN 'C_ICONSET_3ARROWS'
* OR 'C_ICONSET_3ARROWSGRAY'
* OR 'C_ICONSET_3FLAGS'
* OR 'C_ICONSET_3SIGNS'
* OR 'C_ICONSET_3SYMBOLS'
* OR 'C_ICONSET_3SYMBOLS2'
* OR 'C_ICONSET_3TRAFFICLIGHTS'
* OR 'C_ICONSET_3TRAFFICLIGHTS2'.
* lv_needed_values = 3.
*
* WHEN 'C_ICONSET_4ARROWS'
* OR 'C_ICONSET_4ARROWSGRAY'
* OR 'C_ICONSET_4RATING'
* OR 'C_ICONSET_4REDTOBLACK'
* OR 'C_ICONSET_4TRAFFICLIGHTS'.
* lv_needed_values = 4.
*
* WHEN 'C_ICONSET_5ARROWS'
* OR 'C_ICONSET_5ARROWSGRAY'
* OR 'C_ICONSET_5QUARTERS'
* OR 'C_ICONSET_5RATING'.
* lv_needed_values = 5.
*
* WHEN OTHERS.
* RETURN.
* ENDCASE.
ENDMETHOD.METHOD get_dimension_range.
ep_dimension_range = me->mv_rule_range.
ENDMETHOD.METHOD set_range.
CLEAR: me->mv_rule_range.
me->add_range( ip_start_row = ip_start_row
ip_start_column = ip_start_column
ip_stop_row = ip_stop_row
ip_stop_column = ip_stop_column ).
ENDMETHOD.