diff --git a/ZA2X/CLAS/ZCL_EXCEL_READER_2007.slnk b/ZA2X/CLAS/ZCL_EXCEL_READER_2007.slnk
index 9932b3f..ef61935 100644
--- a/ZA2X/CLAS/ZCL_EXCEL_READER_2007.slnk
+++ b/ZA2X/CLAS/ZCL_EXCEL_READER_2007.slnk
@@ -272,6 +272,7 @@ endclass.
IXML
+
@@ -557,6 +558,136 @@ ENDMETHOD.
endmethod.
+
+
+
+
+
+ METHOD get_dxf_style_guid.
+ DATA: lo_ixml_dxf_children TYPE REF TO if_ixml_node_list,
+ lo_ixml_iterator_dxf_children TYPE REF TO if_ixml_node_iterator,
+ lo_ixml_dxf_child TYPE REF TO if_ixml_element,
+
+ lv_dxf_child_type TYPE string,
+
+ lo_ixml_element TYPE REF TO if_ixml_element,
+ lo_ixml_element2 TYPE REF TO if_ixml_element,
+ lv_val TYPE string.
+
+ DATA: ls_cstyle TYPE zexcel_s_cstyle_complete,
+ ls_cstylex TYPE zexcel_s_cstylex_complete.
+
+
+
+ lo_ixml_dxf_children = io_ixml_dxf->get_children( ).
+ lo_ixml_iterator_dxf_children = lo_ixml_dxf_children->create_iterator( ).
+ lo_ixml_dxf_child ?= lo_ixml_iterator_dxf_children->get_next( ).
+ WHILE lo_ixml_dxf_child IS BOUND.
+
+ lv_dxf_child_type = lo_ixml_dxf_child->get_name( ).
+ CASE lv_dxf_child_type.
+
+ WHEN 'font'.
+*--------------------------------------------------------------------*
+* italic
+*--------------------------------------------------------------------*
+ lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'i' ).
+ IF lo_ixml_element IS BOUND.
+ CLEAR lv_val.
+ lv_val = lo_ixml_element->get_attribute_ns( 'val' ).
+ IF lv_val <> '0'.
+ ls_cstyle-font-italic = 'X'.
+ ls_cstylex-font-italic = 'X'.
+ ENDIF.
+
+ ENDIF.
+*--------------------------------------------------------------------*
+* bold
+*--------------------------------------------------------------------*
+ lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'b' ).
+ IF lo_ixml_element IS BOUND.
+ CLEAR lv_val.
+ lv_val = lo_ixml_element->get_attribute_ns( 'val' ).
+ IF lv_val <> '0'.
+ ls_cstyle-font-bold = 'X'.
+ ls_cstylex-font-bold = 'X'.
+ ENDIF.
+
+ ENDIF.
+*--------------------------------------------------------------------*
+* strikethrough
+*--------------------------------------------------------------------*
+ lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'strike' ).
+ IF lo_ixml_element IS BOUND.
+ CLEAR lv_val.
+ lv_val = lo_ixml_element->get_attribute_ns( 'val' ).
+ IF lv_val <> '0'.
+ ls_cstyle-font-strikethrough = 'X'.
+ ls_cstylex-font-strikethrough = 'X'.
+ ENDIF.
+
+ ENDIF.
+*--------------------------------------------------------------------*
+* color
+*--------------------------------------------------------------------*
+ lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'color' ).
+ IF lo_ixml_element IS BOUND.
+ CLEAR lv_val.
+ lv_val = lo_ixml_element->get_attribute_ns( 'rgb' ).
+ ls_cstyle-font-color-rgb = lv_val.
+ ls_cstylex-font-color-rgb = 'X'.
+ ENDIF.
+
+ WHEN 'fill'.
+ lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'patternFill' ).
+ IF lo_ixml_element IS BOUND.
+ lo_ixml_element2 = lo_ixml_element->find_from_name( 'bgColor' ).
+ IF lo_ixml_element2 IS BOUND.
+ CLEAR lv_val.
+ lv_val = lo_ixml_element2->get_attribute_ns( 'rgb' ).
+ IF lv_val IS NOT INITIAL.
+ ls_cstyle-fill-filltype = zcl_excel_style_fill=>c_fill_solid.
+ ls_cstyle-fill-bgcolor-rgb = lv_val.
+ ls_cstylex-fill-filltype = 'X'.
+ ls_cstylex-fill-bgcolor-rgb = 'X'.
+ ENDIF.
+ ENDIF.
+ CLEAR lv_val.
+ lv_val = lo_ixml_element2->get_attribute_ns( 'theme' ).
+ IF lv_val IS NOT INITIAL.
+ ls_cstyle-fill-filltype = zcl_excel_style_fill=>c_fill_solid.
+ ls_cstyle-fill-bgcolor-theme = lv_val.
+ ls_cstylex-fill-filltype = 'X'.
+ ls_cstylex-fill-bgcolor-theme = 'X'.
+ ENDIF.
+ ENDIF.
+
+* 2do - borders into dxf-styles. Here and in writerclass
+* WHEN 'border'.
+* lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'left' ).
+* IF lo_ixml_element IS BOUND.
+* CLEAR lv_val.
+* lv_val = lo_ixml_element2->get_attribute_ns( 'style' ).
+* IF lv_val IS NOT INITIAL.
+* ls_cstyle-borders-left-border_style = lv_val.
+* ls_cstylex-borders-left-border_style = 'X'.
+* ENDIF.
+* ENDIF.
+
+ ENDCASE.
+
+ lo_ixml_dxf_child ?= lo_ixml_iterator_dxf_children->get_next( ).
+
+ ENDWHILE.
+
+
+
+
+ rv_style_guid = io_excel->get_static_cellstyle_guid( ip_cstyle_complete = ls_cstyle
+ ip_cstylex_complete = ls_cstylex ).
+
+
+ENDMETHOD.
@@ -753,6 +884,52 @@ ENDMETHOD.
endmethod.
+
+
+
+
+ METHOD load_dxf_styles.
+
+ DATA: lo_styles_xml TYPE REF TO if_ixml_document,
+ lo_node_dxfs TYPE REF TO if_ixml_element,
+
+ lo_nodes_dxf TYPE REF TO if_ixml_node_collection,
+ lo_iterator_dxf TYPE REF TO if_ixml_node_iterator,
+ lo_node_dxf TYPE REF TO if_ixml_element,
+
+ lv_dxf_count TYPE i.
+
+ FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF mt_dxf_styles.
+
+*--------------------------------------------------------------------*
+* Look for dxfs-node
+*--------------------------------------------------------------------*
+ lo_styles_xml = me->get_ixml_from_zip_archive( iv_path ).
+ lo_node_dxfs = lo_styles_xml->find_from_name( 'dxfs' ).
+ CHECK lo_node_dxfs IS BOUND.
+
+
+*--------------------------------------------------------------------*
+* loop through all dxf-nodes and create style for each
+*--------------------------------------------------------------------*
+ lo_nodes_dxf ?= lo_node_dxfs->get_elements_by_tag_name( 'dxf' ).
+ lo_iterator_dxf = lo_nodes_dxf->create_iterator( ).
+ lo_node_dxf ?= lo_iterator_dxf->get_next( ).
+ WHILE lo_node_dxf IS BOUND.
+
+ APPEND INITIAL LINE TO mt_dxf_styles ASSIGNING <ls_dxf_style>.
+ <ls_dxf_style>-dxf = lv_dxf_count. " We start counting at 0
+ ADD 1 TO lv_dxf_count. " prepare next entry
+
+ <ls_dxf_style>-guid = get_dxf_style_guid( io_ixml_dxf = lo_node_dxf
+ io_excel = io_excel ).
+ lo_node_dxf ?= lo_iterator_dxf->get_next( ).
+
+ ENDWHILE.
+
+
+ENDMETHOD.
+
@@ -876,7 +1053,7 @@ ENDMETHOD.
- method LOAD_STYLES.
+ METHOD load_styles.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
@@ -887,63 +1064,63 @@ ENDMETHOD.
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
TYPES: BEGIN OF lty_xf,
- applyalignment TYPE string,
- applyborder TYPE string,
- applyfill TYPE string,
- applyfont TYPE string,
- applynumberformat TYPE string,
- applyprotection TYPE string,
- borderid TYPE string,
- fillid TYPE string,
- fontid TYPE string,
- numfmtid TYPE string,
- pivotbutton TYPE string,
- quoteprefix TYPE string,
- xfid TYPE string,
+ applyalignment TYPE string,
+ applyborder TYPE string,
+ applyfill TYPE string,
+ applyfont TYPE string,
+ applynumberformat TYPE string,
+ applyprotection TYPE string,
+ borderid TYPE string,
+ fillid TYPE string,
+ fontid TYPE string,
+ numfmtid TYPE string,
+ pivotbutton TYPE string,
+ quoteprefix TYPE string,
+ xfid TYPE string,
END OF lty_xf.
TYPES: BEGIN OF lty_alignment,
- horizontal TYPE string,
- indent TYPE string,
- justifylastline TYPE string,
- readingorder TYPE string,
- relativeindent TYPE string,
- shrinktofit TYPE string,
- textrotation TYPE string,
- vertical TYPE string,
- wraptext TYPE string,
+ horizontal TYPE string,
+ indent TYPE string,
+ justifylastline TYPE string,
+ readingorder TYPE string,
+ relativeindent TYPE string,
+ shrinktofit TYPE string,
+ textrotation TYPE string,
+ vertical TYPE string,
+ wraptext TYPE string,
END OF lty_alignment.
TYPES: BEGIN OF lty_protection,
- hidden TYPE string,
- locked TYPE string,
+ hidden TYPE string,
+ locked TYPE string,
END OF lty_protection.
- DATA: lo_styles_xml TYPE REF TO if_ixml_document,
- lo_style TYPE REF TO zcl_excel_style,
+ DATA: lo_styles_xml TYPE REF TO if_ixml_document,
+ lo_style TYPE REF TO zcl_excel_style,
- lt_num_formats TYPE t_num_formats,
- lt_fills TYPE t_fills,
- lt_borders TYPE t_borders,
- lt_fonts TYPE t_fonts,
+ lt_num_formats TYPE t_num_formats,
+ lt_fills TYPE t_fills,
+ lt_borders TYPE t_borders,
+ lt_fonts TYPE t_fonts,
- ls_num_format TYPE t_num_format,
- ls_fill TYPE REF TO zcl_excel_style_fill,
- ls_cell_border TYPE REF TO zcl_excel_style_borders,
- ls_font TYPE REF TO zcl_excel_style_font,
+ ls_num_format TYPE t_num_format,
+ ls_fill TYPE REF TO zcl_excel_style_fill,
+ ls_cell_border TYPE REF TO zcl_excel_style_borders,
+ ls_font TYPE REF TO zcl_excel_style_font,
- lo_node_cellxfs TYPE REF TO if_ixml_element,
- lo_node_cellxfs_xf TYPE REF TO if_ixml_element,
- lo_node_cellxfs_xf_alignment TYPE REF TO if_ixml_element,
- lo_node_cellxfs_xf_protection TYPE REF TO if_ixml_element,
+ lo_node_cellxfs TYPE REF TO if_ixml_element,
+ lo_node_cellxfs_xf TYPE REF TO if_ixml_element,
+ lo_node_cellxfs_xf_alignment TYPE REF TO if_ixml_element,
+ lo_node_cellxfs_xf_protection TYPE REF TO if_ixml_element,
- lo_nodes_xf TYPE REF TO if_ixml_node_collection,
- lo_iterator_cellxfs TYPE REF TO if_ixml_node_iterator,
+ lo_nodes_xf TYPE REF TO if_ixml_node_collection,
+ lo_iterator_cellxfs TYPE REF TO if_ixml_node_iterator,
- ls_xf TYPE lty_xf,
- ls_alignment TYPE lty_alignment,
- ls_protection TYPE lty_protection,
- lv_index TYPE i.
+ ls_xf TYPE lty_xf,
+ ls_alignment TYPE lty_alignment,
+ ls_protection TYPE lty_protection,
+ lv_index TYPE i.
*--------------------------------------------------------------------*
* To build a complete style that fully describes how a cell looks like
@@ -1109,9 +1286,9 @@ ENDMETHOD.
ENDWHILE.
ENDIF.
- endmethod.
+ENDMETHOD.
-
+ method LOAD_STYLE_BORDERS.
@@ -1241,7 +1418,7 @@ ENDMETHOD.
endmethod.
-
+ method LOAD_STYLE_FILLS.
@@ -1413,7 +1590,7 @@ ENDMETHOD.
endmethod.
-
+ METHOD load_style_fonts.
@@ -1541,7 +1718,7 @@ ENDMETHOD.
ENDMETHOD.
-
+ method LOAD_STYLE_NUM_FORMATS.
@@ -1654,7 +1831,7 @@ ENDMETHOD.
endmethod.
-
+
@@ -1854,6 +2031,8 @@ ENDMETHOD.
INTO lv_full_filename.
me->load_styles( ip_path = lv_full_filename
ip_excel = io_excel ).
+ me->load_dxf_styles( iv_path = lv_full_filename
+ io_excel = io_excel ).
WHEN OTHERS.
@@ -2073,7 +2252,7 @@ ENDMETHOD.
endmethod.
-
+
@@ -2333,7 +2512,7 @@ ENDMETHOD.
TRY.
me->load_worksheet_drawing( ip_path = lv_path
io_worksheet = io_worksheet ).
- CATCH zcx_excel. "--> then ignore it " SS - inserted weil sonst Fehler aber noch nicht zu assembla übertragen
+ CATCH zcx_excel. "--> then ignore it
ENDTRY.
WHEN lc_rel_printer.
@@ -2787,10 +2966,447 @@ ENDMETHOD.
CATCH zcx_excel. " Ignore Hyperlink reading errors - pass everything we were able to identify
ENDTRY.
+ " Issue #366 - conditional formatting
+ TRY.
+ me->load_worksheet_cond_format( io_ixml_worksheet = lo_ixml_worksheet
+ io_worksheet = io_worksheet ).
+ CATCH zcx_excel. " Ignore Hyperlink reading errors - pass everything we were able to identify
+ ENDTRY.
+
+
ENDMETHOD.
-
+
+
+
+
+ METHOD load_worksheet_cond_format.
+
+ DATA: lo_ixml_cond_formats TYPE REF TO if_ixml_node_collection,
+ lo_ixml_cond_format TYPE REF TO if_ixml_element,
+ lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
+* lo_ixml_iterator2 TYPE REF TO if_ixml_node_iterator,
+* lo_ixml TYPE REF TO if_ixml_element,
+ lo_ixml_rule TYPE REF TO if_ixml_element,
+* lo_ixml_rule_iconset TYPE REF TO if_ixml_element,
+ lo_style_conditional TYPE REF TO zcl_excel_style_conditional.
+
+
+ DATA: lv_area TYPE string,
+ lv_area_start_row TYPE zexcel_cell_row,
+ lv_area_end_row TYPE zexcel_cell_row,
+ lv_area_start_col TYPE zexcel_cell_column_alpha,
+ lv_area_end_col TYPE zexcel_cell_column_alpha,
+ lv_rule TYPE zexcel_condition_rule.
+
+
+* FIELD-SYMBOLS: <ls_external_hyperlink> LIKE LINE OF it_external_hyperlinks.
+
+ lo_ixml_cond_formats = io_ixml_worksheet->get_elements_by_tag_name( name = 'conditionalFormatting' ).
+ lo_ixml_iterator = lo_ixml_cond_formats->create_iterator( ).
+ lo_ixml_cond_format ?= lo_ixml_iterator->get_next( ).
+
+ WHILE lo_ixml_cond_format IS BOUND.
+
+ CLEAR: lv_area,
+ lo_ixml_rule,
+ lo_style_conditional.
+
+
+*--------------------------------------------------------------------*
+* Get type of rule
+*--------------------------------------------------------------------*
+ lo_ixml_rule ?= lo_ixml_cond_format->get_first_child( ). " = cfRule
+ IF lo_ixml_rule IS BOUND.
+ lv_rule = lo_ixml_rule->get_attribute_ns( 'type' ).
+
+*--------------------------------------------------------------------*
+* Depending on ruletype get additional information
+*--------------------------------------------------------------------*
+ CASE lv_rule.
+
+ WHEN zcl_excel_style_conditional=>c_rule_cellis.
+ lo_style_conditional = io_worksheet->add_new_conditional_style( ).
+ load_worksheet_cond_format_ci( io_ixml_rule = lo_ixml_rule
+ io_style_conditional = lo_style_conditional ).
+
+* WHEN zcl_excel_style_conditional=>c_rule_containstext.
+*
+ WHEN zcl_excel_style_conditional=>c_rule_databar.
+ lo_style_conditional = io_worksheet->add_new_conditional_style( ).
+ load_worksheet_cond_format_db( io_ixml_rule = lo_ixml_rule
+ io_style_conditional = lo_style_conditional ).
+
+ WHEN zcl_excel_style_conditional=>c_rule_expression.
+ lo_style_conditional = io_worksheet->add_new_conditional_style( ).
+ load_worksheet_cond_format_ex( io_ixml_rule = lo_ixml_rule
+ io_style_conditional = lo_style_conditional ).
+
+ WHEN zcl_excel_style_conditional=>c_rule_iconset.
+ lo_style_conditional = io_worksheet->add_new_conditional_style( ).
+ load_worksheet_cond_format_is( io_ixml_rule = lo_ixml_rule
+ io_style_conditional = lo_style_conditional ).
+
+ WHEN zcl_excel_style_conditional=>c_rule_colorscale.
+ lo_style_conditional = io_worksheet->add_new_conditional_style( ).
+ load_worksheet_cond_format_cs( io_ixml_rule = lo_ixml_rule
+ io_style_conditional = lo_style_conditional ).
+
+ WHEN zcl_excel_style_conditional=>c_rule_top10.
+ lo_style_conditional = io_worksheet->add_new_conditional_style( ).
+ load_worksheet_cond_format_t10( io_ixml_rule = lo_ixml_rule
+ io_style_conditional = lo_style_conditional ).
+
+ WHEN zcl_excel_style_conditional=>c_rule_above_average.
+ lo_style_conditional = io_worksheet->add_new_conditional_style( ).
+ load_worksheet_cond_format_aa( io_ixml_rule = lo_ixml_rule
+ io_style_conditional = lo_style_conditional ).
+
+* WHEN zcl_excel_style_conditional=>c_rule_none.
+*
+
+ WHEN OTHERS.
+ ENDCASE.
+ ENDIF.
+
+ IF lo_style_conditional IS BOUND.
+ lo_style_conditional->rule = lv_rule.
+ lo_style_conditional->priority = lo_ixml_rule->get_attribute_ns( 'priority' ).
+*--------------------------------------------------------------------*
+* Set area to which conditional formatting belongs
+*--------------------------------------------------------------------*
+ lv_area = lo_ixml_cond_format->get_attribute_ns( 'sqref' ).
+ zcl_excel_common=>convert_range2column_a_row( EXPORTING
+ i_range = lv_area
+ IMPORTING
+ e_column_start = lv_area_start_col
+ e_column_end = lv_area_end_col
+ e_row_start = lv_area_start_row
+ e_row_end = lv_area_end_row ).
+ lo_style_conditional->set_range( ip_start_column = lv_area_start_col
+ ip_stop_column = lv_area_end_col
+ ip_start_row = lv_area_start_row
+ ip_stop_row = lv_area_end_row ).
+
+ ENDIF.
+
+
+ lo_ixml_cond_format ?= lo_ixml_iterator->get_next( ).
+
+ ENDWHILE.
+
+ENDMETHOD.
+
+
+
+
+ METHOD load_worksheet_cond_format_aa.
+ DATA: lv_dxf_style_index TYPE i,
+ val TYPE string.
+
+ FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
+
+*--------------------------------------------------------------------*
+* above or below average
+*--------------------------------------------------------------------*
+ val = io_ixml_rule->get_attribute_ns( 'aboveAverage' ).
+ IF val = '0'. " 0 = below average
+ io_style_conditional->mode_above_average-above_average = space.
+ ELSE.
+ io_style_conditional->mode_above_average-above_average = 'X'. " Not present or <> 0 --> we use above average
+ ENDIF.
+
+*--------------------------------------------------------------------*
+* Equal average also?
+*--------------------------------------------------------------------*
+ CLEAR val.
+ val = io_ixml_rule->get_attribute_ns( 'equalAverage' ).
+ IF val = '1'. " 0 = below average
+ io_style_conditional->mode_above_average-equal_average = 'X'.
+ ELSE.
+ io_style_conditional->mode_above_average-equal_average = ' '. " Not present or <> 1 --> we use not equal average
+ ENDIF.
+
+*--------------------------------------------------------------------*
+* Standard deviation instead of value ( 2nd stddev, 3rd stdev )
+*--------------------------------------------------------------------*
+ CLEAR val.
+ val = io_ixml_rule->get_attribute_ns( 'stdDev' ).
+ CASE val.
+ WHEN 1
+ OR 2
+ OR 3. " These seem to be supported by excel - don't try anything more
+ io_style_conditional->mode_above_average-standard_deviation = val.
+ ENDCASE.
+
+*--------------------------------------------------------------------*
+* Cell formatting for top10
+*--------------------------------------------------------------------*
+ lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
+ READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
+ IF sy-subrc = 0.
+ io_style_conditional->mode_above_average-cell_style = <ls_dxf_style>-guid.
+ ENDIF.
+
+ENDMETHOD.
+
+
+
+
+ METHOD load_worksheet_cond_format_ci.
+ DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
+ lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
+ lo_ixml TYPE REF TO if_ixml_element,
+ lv_dxf_style_index TYPE i,
+ lo_excel_style LIKE LINE OF me->styles.
+
+ FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
+
+ io_style_conditional->mode_cellis-operator = io_ixml_rule->get_attribute_ns( 'operator' ).
+ lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
+ READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
+ IF sy-subrc = 0.
+ io_style_conditional->mode_cellis-cell_style = <ls_dxf_style>-guid.
+ ENDIF.
+
+ lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'formula' ).
+ lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ WHILE lo_ixml IS BOUND.
+
+ CASE sy-index.
+ WHEN 1.
+ io_style_conditional->mode_cellis-formula = lo_ixml->get_value( ).
+
+ WHEN 2.
+ io_style_conditional->mode_cellis-formula2 = lo_ixml->get_value( ).
+
+ WHEN OTHERS.
+ EXIT.
+ ENDCASE.
+
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ ENDWHILE.
+
+
+ENDMETHOD.
+
+
+
+
+ METHOD load_worksheet_cond_format_cs.
+ DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
+ lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
+ lo_ixml TYPE REF TO if_ixml_element.
+
+
+ lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'cfvo' ).
+ lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ WHILE lo_ixml IS BOUND.
+
+ CASE sy-index.
+ WHEN 1.
+ io_style_conditional->mode_colorscale-cfvo1_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_colorscale-cfvo1_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN 2.
+ io_style_conditional->mode_colorscale-cfvo2_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_colorscale-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN 3.
+ io_style_conditional->mode_colorscale-cfvo3_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_colorscale-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN OTHERS.
+ EXIT.
+ ENDCASE.
+
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ ENDWHILE.
+
+ lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'color' ).
+ lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ WHILE lo_ixml IS BOUND.
+
+ CASE sy-index.
+ WHEN 1.
+ io_style_conditional->mode_colorscale-colorrgb1 = lo_ixml->get_attribute_ns( 'rgb' ).
+
+ WHEN 2.
+ io_style_conditional->mode_colorscale-colorrgb2 = lo_ixml->get_attribute_ns( 'rgb' ).
+
+ WHEN 3.
+ io_style_conditional->mode_colorscale-colorrgb3 = lo_ixml->get_attribute_ns( 'rgb' ).
+
+ WHEN OTHERS.
+ EXIT.
+ ENDCASE.
+
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ ENDWHILE.
+
+ENDMETHOD.
+
+
+
+
+ METHOD load_worksheet_cond_format_db.
+ DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
+ lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
+ lo_ixml TYPE REF TO if_ixml_element.
+
+ lo_ixml ?= io_ixml_rule->find_from_name( 'color' ).
+ IF lo_ixml IS BOUND.
+ io_style_conditional->mode_databar-colorrgb = lo_ixml->get_attribute_ns( 'rgb' ).
+ ENDIF.
+
+ lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'cfvo' ).
+ lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ WHILE lo_ixml IS BOUND.
+
+ CASE sy-index.
+ WHEN 1.
+ io_style_conditional->mode_databar-cfvo1_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_databar-cfvo1_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN 2.
+ io_style_conditional->mode_databar-cfvo2_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_databar-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN OTHERS.
+ EXIT.
+ ENDCASE.
+
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ ENDWHILE.
+
+
+ENDMETHOD.
+
+
+
+
+ METHOD load_worksheet_cond_format_ex.
+ DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
+ lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
+ lo_ixml TYPE REF TO if_ixml_element,
+ lv_dxf_style_index TYPE i,
+ lo_excel_style LIKE LINE OF me->styles.
+
+ FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
+
+ lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
+ READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
+ IF sy-subrc = 0.
+ io_style_conditional->mode_expression-cell_style = <ls_dxf_style>-guid.
+ ENDIF.
+
+ lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'formula' ).
+ lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ WHILE lo_ixml IS BOUND.
+
+ CASE sy-index.
+ WHEN 1.
+ io_style_conditional->mode_expression-formula = lo_ixml->get_value( ).
+
+
+ WHEN OTHERS.
+ EXIT.
+ ENDCASE.
+
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ ENDWHILE.
+
+
+ENDMETHOD.
+
+
+
+
+ METHOD load_worksheet_cond_format_is.
+ DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
+ lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
+ lo_ixml TYPE REF TO if_ixml_element,
+ lo_ixml_rule_iconset TYPE REF TO if_ixml_element.
+
+ lo_ixml_rule_iconset ?= io_ixml_rule->get_first_child( ).
+ io_style_conditional->mode_iconset-iconset = lo_ixml_rule_iconset->get_attribute_ns( 'iconSet' ).
+ io_style_conditional->mode_iconset-showvalue = lo_ixml_rule_iconset->get_attribute_ns( 'showValue' ).
+ lo_ixml_nodes ?= lo_ixml_rule_iconset->get_elements_by_tag_name( 'cfvo' ).
+ lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ WHILE lo_ixml IS BOUND.
+
+ CASE sy-index.
+ WHEN 1.
+ io_style_conditional->mode_iconset-cfvo1_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_iconset-cfvo1_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN 2.
+ io_style_conditional->mode_iconset-cfvo2_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_iconset-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN 3.
+ io_style_conditional->mode_iconset-cfvo3_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_iconset-cfvo3_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN 4.
+ io_style_conditional->mode_iconset-cfvo4_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_iconset-cfvo4_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN 5.
+ io_style_conditional->mode_iconset-cfvo5_type = lo_ixml->get_attribute_ns( 'type' ).
+ io_style_conditional->mode_iconset-cfvo5_value = lo_ixml->get_attribute_ns( 'val' ).
+
+ WHEN OTHERS.
+ EXIT.
+ ENDCASE.
+
+ lo_ixml ?= lo_ixml_iterator->get_next( ).
+ ENDWHILE.
+
+ENDMETHOD.
+
+
+
+
+ METHOD load_worksheet_cond_format_t10.
+ DATA: lv_dxf_style_index TYPE i.
+
+ FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
+
+ io_style_conditional->mode_top10-topxx_count = io_ixml_rule->get_attribute_ns( 'rank' ). " Top10, Top20, Top 50...
+
+ io_style_conditional->mode_top10-percent = io_ixml_rule->get_attribute_ns( 'percent' ). " Top10 percent instead of Top10 values
+ if io_style_conditional->mode_top10-percent = '1'.
+ io_style_conditional->mode_top10-percent = 'X'.
+ else.
+ io_style_conditional->mode_top10-percent = ' '.
+ endif.
+
+ io_style_conditional->mode_top10-bottom = io_ixml_rule->get_attribute_ns( 'bottom' ). " Bottom10 instead of Top10
+ if io_style_conditional->mode_top10-bottom = '1'.
+ io_style_conditional->mode_top10-bottom = 'X'.
+ else.
+ io_style_conditional->mode_top10-bottom = ' '.
+ endif.
+*--------------------------------------------------------------------*
+* Cell formatting for top10
+*--------------------------------------------------------------------*
+ lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
+ READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
+ IF sy-subrc = 0.
+ io_style_conditional->mode_top10-cell_style = <ls_dxf_style>-guid.
+ ENDIF.
+
+ENDMETHOD.
+
+
@@ -2909,7 +3525,7 @@ ENDMETHOD.
endmethod.
-
+
@@ -2983,7 +3599,7 @@ ENDMETHOD.
ENDMETHOD.
-
+
@@ -3018,7 +3634,7 @@ ENDMETHOD.
ENDMETHOD.
-
+ METHOD read_from_applserver.
@@ -3062,7 +3678,7 @@ ENDMETHOD.
binary_tab = lt_binary_data.
ENDMETHOD.
-
+
@@ -3122,7 +3738,7 @@ ENDMETHOD.
ENDMETHOD.
-
+ method RESOLVE_PATH.
@@ -3166,7 +3782,7 @@ ENDMETHOD.
endmethod.
-
+ method RESOLVE_REFERENCED_FORMULAE.
TYPES: BEGIN OF ty_referenced_cells,
sheet TYPE REF TO zcl_excel_worksheet,
diff --git a/ZA2X/CLAS/ZCL_EXCEL_STYLE_CONDITIONAL.slnk b/ZA2X/CLAS/ZCL_EXCEL_STYLE_CONDITIONAL.slnk
index cbb9715..26a80b9 100644
--- a/ZA2X/CLAS/ZCL_EXCEL_STYLE_CONDITIONAL.slnk
+++ b/ZA2X/CLAS/ZCL_EXCEL_STYLE_CONDITIONAL.slnk
@@ -1,5 +1,5 @@
-
+*"* local class implementation for public class
*"* use this source file for the implementation part of
*"* local helper classes
@@ -8,6 +8,7 @@
*"* implementation or private method's signature
*"* use this source file for any macro definitions you need
*"* in the implementation part of the class
+
@@ -43,6 +44,7 @@
+
@@ -50,17 +52,20 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ method CONSTRUCTOR.
@@ -90,6 +95,60 @@
me->start_cell-cell_column = 1.
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.
diff --git a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk
index 70f533b..bece09f 100644
--- a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk
+++ b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk
@@ -875,6 +875,145 @@ ENDMETHOD.
endmethod.
+
+
+
+
+
+
+
+
+ METHOD create_dxf_style.
+
+ CONSTANTS: lc_xml_node_dxf TYPE string VALUE 'dxf',
+ lc_xml_node_font TYPE string VALUE 'font',
+ lc_xml_node_b TYPE string VALUE 'b', "bold
+ lc_xml_node_i TYPE string VALUE 'i', "italic
+ lc_xml_node_u TYPE string VALUE 'u', "underline
+ lc_xml_node_strike TYPE string VALUE 'strike', "strikethrough
+ lc_xml_attr_val TYPE string VALUE 'val',
+ lc_xml_node_fill TYPE string VALUE 'fill',
+ lc_xml_node_patternfill TYPE string VALUE 'patternFill',
+ lc_xml_attr_patterntype TYPE string VALUE 'patternType',
+ lc_xml_node_fgcolor TYPE string VALUE 'fgColor',
+ lc_xml_node_bgcolor TYPE string VALUE 'bgColor',
+ y TYPE i VALUE 0.
+
+ DATA: ls_styles_mapping TYPE zexcel_s_styles_mapping,
+ ls_cellxfs TYPE zexcel_s_cellxfs,
+ ls_style_cond_mapping TYPE zexcel_s_styles_cond_mapping,
+ lo_sub_element TYPE REF TO if_ixml_element,
+ lo_sub_element_2 TYPE REF TO if_ixml_element,
+ lv_index TYPE i,
+ ls_font TYPE zexcel_s_style_font,
+ lo_element_font TYPE REF TO if_ixml_element,
+ lv_value TYPE string,
+ ls_fill TYPE zexcel_s_style_fill,
+ lo_element_fill TYPE REF TO if_ixml_element,
+ x.
+
+ CHECK iv_cell_style IS NOT INITIAL.
+
+ READ TABLE me->styles_mapping INTO ls_styles_mapping WITH KEY guid = iv_cell_style.
+ ADD 1 TO ls_styles_mapping-style. " the numbering starts from 0
+ READ TABLE it_cellxfs INTO ls_cellxfs INDEX ls_styles_mapping-style.
+ ADD 1 TO ls_cellxfs-fillid. " the numbering starts from 0
+
+ READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY style = ls_styles_mapping-style.
+ IF sy-subrc EQ 0.
+ ls_style_cond_mapping-guid = iv_cell_style.
+ APPEND ls_style_cond_mapping TO me->styles_cond_mapping.
+ ELSE.
+ ls_style_cond_mapping-guid = iv_cell_style.
+ ls_style_cond_mapping-style = ls_styles_mapping-style.
+ ls_style_cond_mapping-dxf = cv_dfx_count.
+ APPEND ls_style_cond_mapping TO me->styles_cond_mapping.
+ ADD 1 TO cv_dfx_count.
+
+ " dxf node
+ lo_sub_element = io_ixml_document->create_simple_element( name = lc_xml_node_dxf
+ parent = io_ixml_document ).
+
+ "Conditional formatting font style correction by Alessandro Iannacci START
+ lv_index = ls_cellxfs-fontid + 1.
+ READ TABLE it_fonts INTO ls_font INDEX lv_index.
+ IF ls_font IS NOT INITIAL.
+ lo_element_font = io_ixml_document->create_simple_element( name = lc_xml_node_font
+ parent = io_ixml_document ).
+ IF ls_font-bold EQ abap_true.
+ lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_b
+ parent = io_ixml_document ).
+ lo_element_font->append_child( new_child = lo_sub_element_2 ).
+ ENDIF.
+ IF ls_font-italic EQ abap_true.
+ lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_i
+ parent = io_ixml_document ).
+ lo_element_font->append_child( new_child = lo_sub_element_2 ).
+ ENDIF.
+ IF ls_font-underline EQ abap_true.
+ lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_u
+ parent = io_ixml_document ).
+ lv_value = ls_font-underline_mode.
+ lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_val
+ value = lv_value ).
+ lo_element_font->append_child( new_child = lo_sub_element_2 ).
+ ENDIF.
+ IF ls_font-strikethrough EQ abap_true.
+ lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_strike
+ parent = io_ixml_document ).
+ lo_element_font->append_child( new_child = lo_sub_element_2 ).
+ ENDIF.
+ "color
+ create_xl_styles_color_node(
+ io_document = io_ixml_document
+ io_parent = lo_element_font
+ is_color = ls_font-color ).
+ lo_sub_element->append_child( new_child = lo_element_font ).
+ ENDIF.
+ "---Conditional formatting font style correction by Alessandro Iannacci END
+
+
+ READ TABLE it_fills INTO ls_fill INDEX ls_cellxfs-fillid.
+ IF ls_fill IS NOT INITIAL.
+ " fill properties
+ lo_element_fill = io_ixml_document->create_simple_element( name = lc_xml_node_fill
+ parent = io_ixml_document ).
+ "pattern
+ lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_patternfill
+ parent = io_ixml_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 = io_ixml_document
+ io_parent = lo_sub_element_2
+ is_color = ls_fill-fgcolor
+ iv_color_elem_name = lc_xml_node_fgcolor ).
+
+ IF ls_fill-fgcolor-rgb IS INITIAL AND
+ ls_fill-fgcolor-indexed EQ zcl_excel_style_color=>c_indexed_not_set AND
+ ls_fill-fgcolor-theme EQ zcl_excel_style_color=>c_theme_not_set AND
+ ls_fill-fgcolor-tint IS INITIAL AND ls_fill-bgcolor-indexed EQ zcl_excel_style_color=>c_indexed_sys_foreground.
+
+ " bgcolor
+ create_xl_styles_color_node(
+ io_document = io_ixml_document
+ io_parent = lo_sub_element_2
+ is_color = ls_fill-bgcolor
+ iv_color_elem_name = lc_xml_node_bgcolor ).
+
+ ENDIF.
+
+ lo_element_fill->append_child( new_child = lo_sub_element_2 ). "pattern
+
+ lo_sub_element->append_child( new_child = lo_element_fill ).
+ ENDIF.
+ ENDIF.
+
+ io_dxf_element->append_child( new_child = lo_sub_element ).
+ENDMETHOD.
+ method CREATE_RELATIONSHIPS.
@@ -2685,155 +2824,155 @@ ENDMETHOD.
** Constant node name
- DATA: lc_xml_node_worksheet TYPE string VALUE 'worksheet',
- lc_xml_node_sheetpr TYPE string VALUE 'sheetPr',
- lc_xml_node_tabcolor TYPE string VALUE 'tabColor',
- lc_xml_node_outlinepr TYPE string VALUE 'outlinePr',
- lc_xml_node_dimension TYPE string VALUE 'dimension',
- lc_xml_node_sheetviews TYPE string VALUE 'sheetViews',
- lc_xml_node_sheetview TYPE string VALUE 'sheetView',
- lc_xml_node_selection TYPE string VALUE 'selection',
- lc_xml_node_pane TYPE string VALUE 'pane',
- lc_xml_node_sheetformatpr TYPE string VALUE 'sheetFormatPr',
- lc_xml_node_cols TYPE string VALUE 'cols',
- lc_xml_node_col TYPE string VALUE 'col',
- lc_xml_node_sheetdata TYPE string VALUE 'sheetData',
- lc_xml_node_row TYPE string VALUE 'row',
- lc_xml_node_c TYPE string VALUE 'c',
- lc_xml_node_v TYPE string VALUE 'v',
- lc_xml_node_f TYPE string VALUE 'f',
- lc_xml_node_sheetprotection TYPE string VALUE 'sheetProtection',
- lc_xml_node_pagemargins TYPE string VALUE 'pageMargins',
- lc_xml_node_pagesetup TYPE string VALUE 'pageSetup',
- lc_xml_node_pagesetuppr TYPE string VALUE 'pageSetUpPr',
- lc_xml_node_condformatting TYPE string VALUE 'conditionalFormatting',
- lc_xml_node_cfrule TYPE string VALUE 'cfRule',
- lc_xml_node_color TYPE string VALUE 'color', " Databar by Albert Lladanosa
- lc_xml_node_databar TYPE string VALUE 'dataBar', " Databar by Albert Lladanosa
- lc_xml_node_colorscale TYPE string VALUE 'colorScale',
- lc_xml_node_iconset TYPE string VALUE 'iconSet',
- lc_xml_node_cfvo TYPE string VALUE 'cfvo',
- lc_xml_node_formula TYPE string VALUE 'formula',
- lc_xml_node_datavalidations TYPE string VALUE 'dataValidations',
- lc_xml_node_datavalidation TYPE string VALUE 'dataValidation',
- lc_xml_node_formula1 TYPE string VALUE 'formula1',
- lc_xml_node_formula2 TYPE string VALUE 'formula2',
- lc_xml_node_mergecell TYPE string VALUE 'mergeCell',
- lc_xml_node_mergecells TYPE string VALUE 'mergeCells',
- lc_xml_node_drawing TYPE string VALUE 'drawing',
- lc_xml_node_headerfooter TYPE string VALUE 'headerFooter',
- lc_xml_node_oddheader TYPE string VALUE 'oddHeader',
- lc_xml_node_oddfooter TYPE string VALUE 'oddFooter',
- lc_xml_node_evenheader TYPE string VALUE 'evenHeader',
- lc_xml_node_evenfooter TYPE string VALUE 'evenFooter',
- lc_xml_node_autofilter TYPE string VALUE 'autoFilter',
- lc_xml_node_filtercolumn TYPE string VALUE 'filterColumn',
- lc_xml_node_filters TYPE string VALUE 'filters',
- lc_xml_node_filter TYPE string VALUE 'filter',
+ DATA: lc_xml_node_worksheet TYPE string VALUE 'worksheet',
+ lc_xml_node_sheetpr TYPE string VALUE 'sheetPr',
+ lc_xml_node_tabcolor TYPE string VALUE 'tabColor',
+ lc_xml_node_outlinepr TYPE string VALUE 'outlinePr',
+ lc_xml_node_dimension TYPE string VALUE 'dimension',
+ lc_xml_node_sheetviews TYPE string VALUE 'sheetViews',
+ lc_xml_node_sheetview TYPE string VALUE 'sheetView',
+ lc_xml_node_selection TYPE string VALUE 'selection',
+ lc_xml_node_pane TYPE string VALUE 'pane',
+ lc_xml_node_sheetformatpr TYPE string VALUE 'sheetFormatPr',
+ lc_xml_node_cols TYPE string VALUE 'cols',
+ lc_xml_node_col TYPE string VALUE 'col',
+ lc_xml_node_sheetdata TYPE string VALUE 'sheetData',
+ lc_xml_node_row TYPE string VALUE 'row',
+ lc_xml_node_c TYPE string VALUE 'c',
+ lc_xml_node_v TYPE string VALUE 'v',
+ lc_xml_node_f TYPE string VALUE 'f',
+ lc_xml_node_sheetprotection TYPE string VALUE 'sheetProtection',
+ lc_xml_node_pagemargins TYPE string VALUE 'pageMargins',
+ lc_xml_node_pagesetup TYPE string VALUE 'pageSetup',
+ lc_xml_node_pagesetuppr TYPE string VALUE 'pageSetUpPr',
+ lc_xml_node_condformatting TYPE string VALUE 'conditionalFormatting',
+ lc_xml_node_cfrule TYPE string VALUE 'cfRule',
+ lc_xml_node_color TYPE string VALUE 'color', " Databar by Albert Lladanosa
+ lc_xml_node_databar TYPE string VALUE 'dataBar', " Databar by Albert Lladanosa
+ lc_xml_node_colorscale TYPE string VALUE 'colorScale',
+ lc_xml_node_iconset TYPE string VALUE 'iconSet',
+ lc_xml_node_cfvo TYPE string VALUE 'cfvo',
+ lc_xml_node_formula TYPE string VALUE 'formula',
+ lc_xml_node_datavalidations TYPE string VALUE 'dataValidations',
+ lc_xml_node_datavalidation TYPE string VALUE 'dataValidation',
+ lc_xml_node_formula1 TYPE string VALUE 'formula1',
+ lc_xml_node_formula2 TYPE string VALUE 'formula2',
+ lc_xml_node_mergecell TYPE string VALUE 'mergeCell',
+ lc_xml_node_mergecells TYPE string VALUE 'mergeCells',
+ lc_xml_node_drawing TYPE string VALUE 'drawing',
+ lc_xml_node_headerfooter TYPE string VALUE 'headerFooter',
+ lc_xml_node_oddheader TYPE string VALUE 'oddHeader',
+ lc_xml_node_oddfooter TYPE string VALUE 'oddFooter',
+ lc_xml_node_evenheader TYPE string VALUE 'evenHeader',
+ lc_xml_node_evenfooter TYPE string VALUE 'evenFooter',
+ lc_xml_node_autofilter TYPE string VALUE 'autoFilter',
+ lc_xml_node_filtercolumn TYPE string VALUE 'filterColumn',
+ lc_xml_node_filters TYPE string VALUE 'filters',
+ lc_xml_node_filter TYPE string VALUE 'filter',
" Node attributes
- lc_xml_attr_ref TYPE string VALUE 'ref',
- lc_xml_attr_summarybelow TYPE string VALUE 'summaryBelow',
- lc_xml_attr_summaryright TYPE string VALUE 'summaryRight',
- lc_xml_attr_tabselected TYPE string VALUE 'tabSelected',
- lc_xml_attr_showzeros TYPE string VALUE 'showZeros',
- lc_xml_attr_zoomscale TYPE string VALUE 'zoomScale',
- lc_xml_attr_zoomscalenormal TYPE string VALUE 'zoomScaleNormal',
- lc_xml_attr_zoomscalepageview TYPE string VALUE 'zoomScalePageLayoutView',
- lc_xml_attr_zoomscalesheetview TYPE string VALUE 'zoomScaleSheetLayoutView',
- lc_xml_attr_workbookviewid TYPE string VALUE 'workbookViewId',
- lc_xml_attr_showgridlines TYPE string VALUE 'showGridLines',
- lc_xml_attr_gridlines TYPE string VALUE 'gridLines',
- lc_xml_attr_showrowcolheaders TYPE string VALUE 'showRowColHeaders',
- lc_xml_attr_activecell TYPE string VALUE 'activeCell',
- lc_xml_attr_sqref TYPE string VALUE 'sqref',
- lc_xml_attr_min TYPE string VALUE 'min',
- lc_xml_attr_max TYPE string VALUE 'max',
- lc_xml_attr_hidden TYPE string VALUE 'hidden',
- lc_xml_attr_width TYPE string VALUE 'width',
- lc_xml_attr_defaultwidth TYPE string VALUE '9.10',
- lc_xml_attr_style TYPE string VALUE 'style',
- lc_xml_attr_true TYPE string VALUE 'true',
- lc_xml_attr_bestfit TYPE string VALUE 'bestFit',
- lc_xml_attr_customheight TYPE string VALUE 'customHeight',
- lc_xml_attr_customwidth TYPE string VALUE 'customWidth',
- lc_xml_attr_collapsed TYPE string VALUE 'collapsed',
- lc_xml_attr_defaultrowheight TYPE string VALUE 'defaultRowHeight',
- lc_xml_attr_defaultcolwidth TYPE string VALUE 'defaultColWidth',
- lc_xml_attr_outlinelevelrow TYPE string VALUE 'x14ac:outlineLevelRow',
- lc_xml_attr_outlinelevelcol TYPE string VALUE 'x14ac:outlineLevelCol',
- lc_xml_attr_outlinelevel TYPE string VALUE 'outlineLevel',
- lc_xml_attr_r TYPE string VALUE 'r',
- lc_xml_attr_s TYPE string VALUE 's',
- lc_xml_attr_spans TYPE string VALUE 'spans',
- lc_xml_attr_t TYPE string VALUE 't',
- lc_xml_attr_password TYPE string VALUE 'password',
- lc_xml_attr_sheet TYPE string VALUE 'sheet',
- lc_xml_attr_objects TYPE string VALUE 'objects',
- lc_xml_attr_scenarios TYPE string VALUE 'scenarios',
- lc_xml_attr_autofilter TYPE string VALUE 'autoFilter',
- lc_xml_attr_deletecolumns TYPE string VALUE 'deleteColumns',
- lc_xml_attr_deleterows TYPE string VALUE 'deleteRows',
- lc_xml_attr_formatcells TYPE string VALUE 'formatCells',
- lc_xml_attr_formatcolumns TYPE string VALUE 'formatColumns',
- lc_xml_attr_formatrows TYPE string VALUE 'formatRows',
- lc_xml_attr_insertcolumns TYPE string VALUE 'insertColumns',
- lc_xml_attr_inserthyperlinks TYPE string VALUE 'insertHyperlinks',
- lc_xml_attr_insertrows TYPE string VALUE 'insertRows',
- lc_xml_attr_pivottables TYPE string VALUE 'pivotTables',
- lc_xml_attr_selectlockedcells TYPE string VALUE 'selectLockedCells',
- lc_xml_attr_selectunlockedcell TYPE string VALUE 'selectUnlockedCells',
- lc_xml_attr_sort TYPE string VALUE 'sort',
- lc_xml_attr_left TYPE string VALUE 'left',
- lc_xml_attr_right TYPE string VALUE 'right',
- lc_xml_attr_top TYPE string VALUE 'top',
- lc_xml_attr_bottom TYPE string VALUE 'bottom',
- lc_xml_attr_header TYPE string VALUE 'header',
- 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',
- lc_xml_attr_operator TYPE string VALUE 'operator',
- lc_xml_attr_allowblank TYPE string VALUE 'allowBlank',
- lc_xml_attr_showinputmessage TYPE string VALUE 'showInputMessage',
- lc_xml_attr_showerrormessage TYPE string VALUE 'showErrorMessage',
- lc_xml_attr_errortitle TYPE string VALUE 'errorTitle',
- lc_xml_attr_error TYPE string VALUE 'error',
- lc_xml_attr_prompttitle TYPE string VALUE 'promptTitle',
- lc_xml_attr_prompt TYPE string VALUE 'prompt',
- lc_xml_attr_count TYPE string VALUE 'count',
- lc_xml_attr_blackandwhite TYPE string VALUE 'blackAndWhite',
- lc_xml_attr_cellcomments TYPE string VALUE 'cellComments',
- lc_xml_attr_copies TYPE string VALUE 'copies',
- lc_xml_attr_draft TYPE string VALUE 'draft',
- lc_xml_attr_errors TYPE string VALUE 'errors',
- lc_xml_attr_firstpagenumber TYPE string VALUE 'firstPageNumber',
- lc_xml_attr_fittopage TYPE string VALUE 'fitToPage',
- lc_xml_attr_fittoheight TYPE string VALUE 'fitToHeight',
- lc_xml_attr_fittowidth TYPE string VALUE 'fitToWidth',
- lc_xml_attr_horizontaldpi TYPE string VALUE 'horizontalDpi',
- lc_xml_attr_orientation TYPE string VALUE 'orientation',
- lc_xml_attr_pageorder TYPE string VALUE 'pageOrder',
- lc_xml_attr_paperheight TYPE string VALUE 'paperHeight',
- lc_xml_attr_papersize TYPE string VALUE 'paperSize',
- lc_xml_attr_paperwidth TYPE string VALUE 'paperWidth',
- lc_xml_attr_scale TYPE string VALUE 'scale',
- lc_xml_attr_usefirstpagenumber TYPE string VALUE 'useFirstPageNumber',
- lc_xml_attr_useprinterdefaults TYPE string VALUE 'usePrinterDefaults',
- lc_xml_attr_verticaldpi TYPE string VALUE 'verticalDpi',
- lc_xml_attr_differentoddeven TYPE string VALUE 'differentOddEven',
- lc_xml_attr_colid TYPE string VALUE 'colId',
- lc_xml_attr_filtermode TYPE string VALUE 'filterMode',
- lc_xml_attr_tabcolor_rgb TYPE string VALUE 'rgb',
- lc_xml_attr_tabcolor_theme TYPE string VALUE 'theme',
+ lc_xml_attr_ref TYPE string VALUE 'ref',
+ lc_xml_attr_summarybelow TYPE string VALUE 'summaryBelow',
+ lc_xml_attr_summaryright TYPE string VALUE 'summaryRight',
+ lc_xml_attr_tabselected TYPE string VALUE 'tabSelected',
+ lc_xml_attr_showzeros TYPE string VALUE 'showZeros',
+ lc_xml_attr_zoomscale TYPE string VALUE 'zoomScale',
+ lc_xml_attr_zoomscalenormal TYPE string VALUE 'zoomScaleNormal',
+ lc_xml_attr_zoomscalepageview TYPE string VALUE 'zoomScalePageLayoutView',
+ lc_xml_attr_zoomscalesheetview TYPE string VALUE 'zoomScaleSheetLayoutView',
+ lc_xml_attr_workbookviewid TYPE string VALUE 'workbookViewId',
+ lc_xml_attr_showgridlines TYPE string VALUE 'showGridLines',
+ lc_xml_attr_gridlines TYPE string VALUE 'gridLines',
+ lc_xml_attr_showrowcolheaders TYPE string VALUE 'showRowColHeaders',
+ lc_xml_attr_activecell TYPE string VALUE 'activeCell',
+ lc_xml_attr_sqref TYPE string VALUE 'sqref',
+ lc_xml_attr_min TYPE string VALUE 'min',
+ lc_xml_attr_max TYPE string VALUE 'max',
+ lc_xml_attr_hidden TYPE string VALUE 'hidden',
+ lc_xml_attr_width TYPE string VALUE 'width',
+ lc_xml_attr_defaultwidth TYPE string VALUE '9.10',
+ lc_xml_attr_style TYPE string VALUE 'style',
+ lc_xml_attr_true TYPE string VALUE 'true',
+ lc_xml_attr_bestfit TYPE string VALUE 'bestFit',
+ lc_xml_attr_customheight TYPE string VALUE 'customHeight',
+ lc_xml_attr_customwidth TYPE string VALUE 'customWidth',
+ lc_xml_attr_collapsed TYPE string VALUE 'collapsed',
+ lc_xml_attr_defaultrowheight TYPE string VALUE 'defaultRowHeight',
+ lc_xml_attr_defaultcolwidth TYPE string VALUE 'defaultColWidth',
+ lc_xml_attr_outlinelevelrow TYPE string VALUE 'x14ac:outlineLevelRow',
+ lc_xml_attr_outlinelevelcol TYPE string VALUE 'x14ac:outlineLevelCol',
+ lc_xml_attr_outlinelevel TYPE string VALUE 'outlineLevel',
+ lc_xml_attr_r TYPE string VALUE 'r',
+ lc_xml_attr_s TYPE string VALUE 's',
+ lc_xml_attr_spans TYPE string VALUE 'spans',
+ lc_xml_attr_t TYPE string VALUE 't',
+ lc_xml_attr_password TYPE string VALUE 'password',
+ lc_xml_attr_sheet TYPE string VALUE 'sheet',
+ lc_xml_attr_objects TYPE string VALUE 'objects',
+ lc_xml_attr_scenarios TYPE string VALUE 'scenarios',
+ lc_xml_attr_autofilter TYPE string VALUE 'autoFilter',
+ lc_xml_attr_deletecolumns TYPE string VALUE 'deleteColumns',
+ lc_xml_attr_deleterows TYPE string VALUE 'deleteRows',
+ lc_xml_attr_formatcells TYPE string VALUE 'formatCells',
+ lc_xml_attr_formatcolumns TYPE string VALUE 'formatColumns',
+ lc_xml_attr_formatrows TYPE string VALUE 'formatRows',
+ lc_xml_attr_insertcolumns TYPE string VALUE 'insertColumns',
+ lc_xml_attr_inserthyperlinks TYPE string VALUE 'insertHyperlinks',
+ lc_xml_attr_insertrows TYPE string VALUE 'insertRows',
+ lc_xml_attr_pivottables TYPE string VALUE 'pivotTables',
+ lc_xml_attr_selectlockedcells TYPE string VALUE 'selectLockedCells',
+ lc_xml_attr_selectunlockedcell TYPE string VALUE 'selectUnlockedCells',
+ lc_xml_attr_sort TYPE string VALUE 'sort',
+ lc_xml_attr_left TYPE string VALUE 'left',
+ lc_xml_attr_right TYPE string VALUE 'right',
+ lc_xml_attr_top TYPE string VALUE 'top',
+ lc_xml_attr_bottom TYPE string VALUE 'bottom',
+ lc_xml_attr_header TYPE string VALUE 'header',
+ 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',
+ lc_xml_attr_operator TYPE string VALUE 'operator',
+ lc_xml_attr_allowblank TYPE string VALUE 'allowBlank',
+ lc_xml_attr_showinputmessage TYPE string VALUE 'showInputMessage',
+ lc_xml_attr_showerrormessage TYPE string VALUE 'showErrorMessage',
+ lc_xml_attr_errortitle TYPE string VALUE 'errorTitle',
+ lc_xml_attr_error TYPE string VALUE 'error',
+ lc_xml_attr_prompttitle TYPE string VALUE 'promptTitle',
+ lc_xml_attr_prompt TYPE string VALUE 'prompt',
+ lc_xml_attr_count TYPE string VALUE 'count',
+ lc_xml_attr_blackandwhite TYPE string VALUE 'blackAndWhite',
+ lc_xml_attr_cellcomments TYPE string VALUE 'cellComments',
+ lc_xml_attr_copies TYPE string VALUE 'copies',
+ lc_xml_attr_draft TYPE string VALUE 'draft',
+ lc_xml_attr_errors TYPE string VALUE 'errors',
+ lc_xml_attr_firstpagenumber TYPE string VALUE 'firstPageNumber',
+ lc_xml_attr_fittopage TYPE string VALUE 'fitToPage',
+ lc_xml_attr_fittoheight TYPE string VALUE 'fitToHeight',
+ lc_xml_attr_fittowidth TYPE string VALUE 'fitToWidth',
+ lc_xml_attr_horizontaldpi TYPE string VALUE 'horizontalDpi',
+ lc_xml_attr_orientation TYPE string VALUE 'orientation',
+ lc_xml_attr_pageorder TYPE string VALUE 'pageOrder',
+ lc_xml_attr_paperheight TYPE string VALUE 'paperHeight',
+ lc_xml_attr_papersize TYPE string VALUE 'paperSize',
+ lc_xml_attr_paperwidth TYPE string VALUE 'paperWidth',
+ lc_xml_attr_scale TYPE string VALUE 'scale',
+ lc_xml_attr_usefirstpagenumber TYPE string VALUE 'useFirstPageNumber',
+ lc_xml_attr_useprinterdefaults TYPE string VALUE 'usePrinterDefaults',
+ lc_xml_attr_verticaldpi TYPE string VALUE 'verticalDpi',
+ lc_xml_attr_differentoddeven TYPE string VALUE 'differentOddEven',
+ lc_xml_attr_colid TYPE string VALUE 'colId',
+ lc_xml_attr_filtermode TYPE string VALUE 'filterMode',
+ lc_xml_attr_tabcolor_rgb TYPE string VALUE 'rgb',
+ lc_xml_attr_tabcolor_theme TYPE string VALUE 'theme',
" Node namespace
- lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
- lc_xml_node_r_ns TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
- lc_xml_node_comp_ns TYPE string VALUE 'http://schemas.openxmlformats.org/markup-compatibility/2006',
- lc_xml_node_comp_pref TYPE string VALUE 'x14ac',
- lc_xml_node_ig_ns TYPE string VALUE 'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac'.
+ lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
+ lc_xml_node_r_ns TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
+ lc_xml_node_comp_ns TYPE string VALUE 'http://schemas.openxmlformats.org/markup-compatibility/2006',
+ lc_xml_node_comp_pref TYPE string VALUE 'x14ac',
+ lc_xml_node_ig_ns TYPE string VALUE 'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac'.
DATA: lo_ixml TYPE REF TO if_ixml,
lo_document TYPE REF TO if_ixml_document,
@@ -2868,6 +3007,8 @@ ENDMETHOD.
ls_iconset TYPE zexcel_conditional_iconset,
ls_cellis TYPE zexcel_conditional_cellis,
ls_expression TYPE zexcel_conditional_expression,
+ ls_conditional_top10 TYPE zexcel_conditional_top10,
+ ls_conditional_above_avg TYPE zexcel_conditional_above_avg,
lt_cfvo TYPE TABLE OF cfvo,
ls_cfvo TYPE cfvo,
lt_colors TYPE TABLE OF colors,
@@ -3854,6 +3995,7 @@ ENDMETHOD.
lo_element_2->append_child( new_child = lo_element_3 ). " databar node
" End << Databar by Albert Lladanosa
+
WHEN zcl_excel_style_conditional=>c_rule_colorscale.
ls_colorscale = lo_style_conditional->mode_colorscale.
@@ -3911,6 +4053,7 @@ ENDMETHOD.
ENDLOOP.
lo_element_2->append_child( new_child = lo_element_3 ). " databar node
+
WHEN zcl_excel_style_conditional=>c_rule_iconset.
ls_iconset = lo_style_conditional->mode_iconset.
@@ -4004,6 +4147,7 @@ ENDMETHOD.
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.
@@ -4020,6 +4164,14 @@ ENDMETHOD.
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
+ IF ls_cellis-formula2 IS NOT INITIAL.
+ lv_value = ls_cellis-formula2.
+ lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_formula
+ parent = lo_document ).
+ lo_element_3->set_value( value = lv_value ).
+ lo_element_2->append_child( new_child = lo_element_3 ). " 2nd formula node
+ ENDIF.
+
WHEN zcl_excel_style_conditional=>c_rule_expression.
ls_expression = lo_style_conditional->mode_expression.
READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY guid = ls_expression-cell_style.
@@ -4033,6 +4185,52 @@ ENDMETHOD.
lv_value = ls_expression-formula.
lo_element_3->set_value( value = lv_value ).
lo_element_2->append_child( new_child = lo_element_3 ). " formula node
+
+* begin of ins issue #366 - missing conditional rules: top10
+ WHEN zcl_excel_style_conditional=>c_rule_top10.
+ ls_conditional_top10 = lo_style_conditional->mode_top10.
+ READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY guid = ls_conditional_top10-cell_style.
+ lv_value = ls_style_cond_mapping-dxf.
+ CONDENSE lv_value.
+ lo_element_2->set_attribute_ns( name = lc_xml_attr_dxfid
+ value = lv_value ).
+ lv_value = ls_conditional_top10-topxx_count.
+ CONDENSE lv_value.
+ lo_element_2->set_attribute_ns( name = 'rank'
+ value = lv_value ).
+ IF ls_conditional_top10-bottom = 'X'.
+ lo_element_2->set_attribute_ns( name = 'bottom'
+ value = '1' ).
+ ENDIF.
+ IF ls_conditional_top10-percent = 'X'.
+ lo_element_2->set_attribute_ns( name = 'percent'
+ value ='1' ).
+ ENDIF.
+
+ WHEN zcl_excel_style_conditional=>c_rule_above_average.
+ ls_conditional_above_avg = lo_style_conditional->mode_above_average.
+ READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY guid = ls_conditional_above_avg-cell_style.
+ lv_value = ls_style_cond_mapping-dxf.
+ CONDENSE lv_value.
+ lo_element_2->set_attribute_ns( name = lc_xml_attr_dxfid
+ value = lv_value ).
+
+ IF ls_conditional_above_avg-above_average IS INITIAL. " = below average
+ lo_element_2->set_attribute_ns( name = 'aboveAverage'
+ value = '0' ).
+ ENDIF.
+ IF ls_conditional_above_avg-equal_average = 'X'. " = equal average also
+ lo_element_2->set_attribute_ns( name = 'equalAverage'
+ value = '1' ).
+ ENDIF.
+ IF ls_conditional_above_avg-standard_deviation <> 0. " standard deviation instead of value
+ lv_value = ls_conditional_above_avg-standard_deviation.
+ lo_element_2->set_attribute_ns( name = 'stdDev'
+ value = lv_value ).
+ ENDIF.
+
+* end of ins issue #366 - missing conditional rules: top10
+
ENDCASE.
lo_element->append_child( new_child = lo_element_2 ). " cfRule node
@@ -4640,59 +4838,65 @@ ENDMETHOD.
METHOD create_xl_styles.
+*--------------------------------------------------------------------*
+* ToDos:
+* 2do§1 dxfs-cellstyles are used in conditional formats:
+* CellIs, Expression, top10 ( forthcoming above average as well )
+* create own method to write dsfx-cellstyle to be reuseable by all these
+*--------------------------------------------------------------------*
** Constant node name
- CONSTANTS: lc_xml_node_stylesheet TYPE string VALUE 'styleSheet',
+ CONSTANTS: lc_xml_node_stylesheet TYPE string VALUE 'styleSheet',
" font
- lc_xml_node_fonts TYPE string VALUE 'fonts',
- lc_xml_node_font TYPE string VALUE 'font',
- lc_xml_node_b TYPE string VALUE 'b', "bold
- lc_xml_node_i TYPE string VALUE 'i', "italic
- lc_xml_node_u TYPE string VALUE 'u', "underline
- lc_xml_node_strike TYPE string VALUE 'strike', "strikethrough
- lc_xml_node_sz TYPE string VALUE 'sz',
- lc_xml_node_color TYPE string VALUE 'color',
- lc_xml_node_name TYPE string VALUE 'name',
- lc_xml_node_family TYPE string VALUE 'family',
- lc_xml_node_scheme TYPE string VALUE 'scheme',
+ lc_xml_node_fonts TYPE string VALUE 'fonts',
+ lc_xml_node_font TYPE string VALUE 'font',
+ lc_xml_node_b TYPE string VALUE 'b', "bold
+ lc_xml_node_i TYPE string VALUE 'i', "italic
+ lc_xml_node_u TYPE string VALUE 'u', "underline
+ lc_xml_node_strike TYPE string VALUE 'strike', "strikethrough
+ lc_xml_node_sz TYPE string VALUE 'sz',
+ lc_xml_node_color TYPE string VALUE 'color',
+ lc_xml_node_name TYPE string VALUE 'name',
+ lc_xml_node_family TYPE string VALUE 'family',
+ lc_xml_node_scheme TYPE string VALUE 'scheme',
" fill
- lc_xml_node_fills TYPE string VALUE 'fills',
- lc_xml_node_fill TYPE string VALUE 'fill',
- lc_xml_node_patternfill TYPE string VALUE 'patternFill',
- lc_xml_node_fgcolor TYPE string VALUE 'fgColor',
- lc_xml_node_bgcolor TYPE string VALUE 'bgColor',
- lc_xml_node_gradientfill TYPE string VALUE 'gradientFill',
- lc_xml_node_stop TYPE string VALUE 'stop',
+ lc_xml_node_fills TYPE string VALUE 'fills',
+ lc_xml_node_fill TYPE string VALUE 'fill',
+ lc_xml_node_patternfill TYPE string VALUE 'patternFill',
+ lc_xml_node_fgcolor TYPE string VALUE 'fgColor',
+ lc_xml_node_bgcolor TYPE string VALUE 'bgColor',
+ lc_xml_node_gradientfill TYPE string VALUE 'gradientFill',
+ lc_xml_node_stop TYPE string VALUE 'stop',
" borders
- lc_xml_node_borders TYPE string VALUE 'borders',
- lc_xml_node_border TYPE string VALUE 'border',
- lc_xml_node_left TYPE string VALUE 'left',
- lc_xml_node_right TYPE string VALUE 'right',
- lc_xml_node_top TYPE string VALUE 'top',
- lc_xml_node_bottom TYPE string VALUE 'bottom',
- lc_xml_node_diagonal TYPE string VALUE 'diagonal',
+ lc_xml_node_borders TYPE string VALUE 'borders',
+ lc_xml_node_border TYPE string VALUE 'border',
+ lc_xml_node_left TYPE string VALUE 'left',
+ lc_xml_node_right TYPE string VALUE 'right',
+ lc_xml_node_top TYPE string VALUE 'top',
+ lc_xml_node_bottom TYPE string VALUE 'bottom',
+ lc_xml_node_diagonal TYPE string VALUE 'diagonal',
" numfmt
- lc_xml_node_numfmts TYPE string VALUE 'numFmts',
- lc_xml_node_numfmt TYPE string VALUE 'numFmt',
+ lc_xml_node_numfmts TYPE string VALUE 'numFmts',
+ lc_xml_node_numfmt TYPE string VALUE 'numFmt',
" Styles
- lc_xml_node_cellstylexfs TYPE string VALUE 'cellStyleXfs',
- lc_xml_node_xf TYPE string VALUE 'xf',
- lc_xml_node_cellxfs TYPE string VALUE 'cellXfs',
- 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',
+ lc_xml_node_cellstylexfs TYPE string VALUE 'cellStyleXfs',
+ lc_xml_node_xf TYPE string VALUE 'xf',
+ lc_xml_node_cellxfs TYPE string VALUE 'cellXfs',
+ 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',
- lc_xml_node_indexedcolors TYPE string VALUE 'indexedColors',
- lc_xml_node_rgbcolor TYPE string VALUE 'rgbColor',
- lc_xml_node_mrucolors TYPE string VALUE 'mruColors',
+ lc_xml_node_colors TYPE string VALUE 'colors',
+ lc_xml_node_indexedcolors TYPE string VALUE 'indexedColors',
+ lc_xml_node_rgbcolor TYPE string VALUE 'rgbColor',
+ lc_xml_node_mrucolors TYPE string VALUE 'mruColors',
" Alignment
- lc_xml_node_alignment TYPE string VALUE 'alignment',
+ lc_xml_node_alignment TYPE string VALUE 'alignment',
" Protection
- lc_xml_node_protection TYPE string VALUE 'protection',
+ lc_xml_node_protection TYPE string VALUE 'protection',
" Node attributes
lc_xml_attr_count TYPE string VALUE 'count',
lc_xml_attr_val TYPE string VALUE 'val',
@@ -4732,67 +4936,69 @@ ENDMETHOD.
lc_xml_attr_diagonaldown TYPE string VALUE 'diagonalDown',
" Node namespace
lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
- lc_xml_attr_type TYPE string value 'type',
- lc_xml_attr_bottom TYPE string value 'bottom',
- lc_xml_attr_top TYPE string value 'top',
- lc_xml_attr_right TYPE string value 'right',
- lc_xml_attr_left TYPE string value 'left'.
+ lc_xml_attr_type TYPE string VALUE 'type',
+ lc_xml_attr_bottom TYPE string VALUE 'bottom',
+ lc_xml_attr_top TYPE string VALUE 'top',
+ lc_xml_attr_right TYPE string VALUE 'right',
+ lc_xml_attr_left TYPE string VALUE 'left'.
- DATA: lo_ixml TYPE REF TO if_ixml,
- lo_document TYPE REF TO if_ixml_document,
- lo_element_root TYPE REF TO if_ixml_element,
- lo_element_fonts TYPE REF TO if_ixml_element,
- lo_element_font TYPE REF TO if_ixml_element,
- lo_element_fills TYPE REF TO if_ixml_element,
- lo_element_fill TYPE REF TO if_ixml_element,
- lo_element_borders TYPE REF TO if_ixml_element,
- lo_element_border TYPE REF TO if_ixml_element,
- lo_element_numfmts TYPE REF TO if_ixml_element,
- lo_element_numfmt TYPE REF TO if_ixml_element,
- lo_element_cellxfs TYPE REF TO if_ixml_element,
- lo_element TYPE REF TO if_ixml_element,
- lo_sub_element TYPE REF TO if_ixml_element,
- lo_sub_element_2 TYPE REF TO if_ixml_element,
- lo_encoding TYPE REF TO if_ixml_encoding,
- lo_streamfactory TYPE REF TO if_ixml_stream_factory,
- 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,
+ DATA: lo_ixml TYPE REF TO if_ixml,
+ lo_document TYPE REF TO if_ixml_document,
+ lo_element_root TYPE REF TO if_ixml_element,
+ lo_element_fonts TYPE REF TO if_ixml_element,
+ lo_element_font TYPE REF TO if_ixml_element,
+ lo_element_fills TYPE REF TO if_ixml_element,
+ lo_element_fill TYPE REF TO if_ixml_element,
+ lo_element_borders TYPE REF TO if_ixml_element,
+ lo_element_border TYPE REF TO if_ixml_element,
+ lo_element_numfmts TYPE REF TO if_ixml_element,
+ lo_element_numfmt TYPE REF TO if_ixml_element,
+ lo_element_cellxfs TYPE REF TO if_ixml_element,
+ lo_element TYPE REF TO if_ixml_element,
+ lo_sub_element TYPE REF TO if_ixml_element,
+ lo_sub_element_2 TYPE REF TO if_ixml_element,
+ lo_encoding TYPE REF TO if_ixml_encoding,
+ lo_streamfactory TYPE REF TO if_ixml_stream_factory,
+ 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.
+ lo_style TYPE REF TO zcl_excel_style.
- DATA: lt_fonts TYPE zexcel_t_style_font,
- ls_font TYPE zexcel_s_style_font,
- lt_fills TYPE zexcel_t_style_fill,
- ls_fill TYPE zexcel_s_style_fill,
- lt_borders TYPE zexcel_t_style_border,
- ls_border TYPE zexcel_s_style_border,
- lt_numfmts TYPE zexcel_t_style_numfmt,
- ls_numfmt TYPE zexcel_s_style_numfmt,
- lt_protections TYPE zexcel_t_style_protection,
- ls_protection TYPE zexcel_s_style_protection,
- lt_alignments TYPE zexcel_t_style_alignment,
- 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,
+ DATA: lt_fonts TYPE zexcel_t_style_font,
+ ls_font TYPE zexcel_s_style_font,
+ lt_fills TYPE zexcel_t_style_fill,
+ ls_fill TYPE zexcel_s_style_fill,
+ lt_borders TYPE zexcel_t_style_border,
+ ls_border TYPE zexcel_s_style_border,
+ lt_numfmts TYPE zexcel_t_style_numfmt,
+ ls_numfmt TYPE zexcel_s_style_numfmt,
+ lt_protections TYPE zexcel_t_style_protection,
+ ls_protection TYPE zexcel_s_style_protection,
+ lt_alignments TYPE zexcel_t_style_alignment,
+ 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_style_cond_mapping TYPE zexcel_s_styles_cond_mapping,
- ls_cellis TYPE zexcel_conditional_cellis,
- ls_expression TYPE zexcel_conditional_expression,
- lt_colors TYPE zexcel_t_style_color_argb,
- ls_color LIKE LINE OF lt_colors.
+ ls_cellis TYPE zexcel_conditional_cellis,
+ ls_expression TYPE zexcel_conditional_expression,
+ ls_conditional_top10 TYPE zexcel_conditional_top10,
- 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,
- lv_cellxfs_count TYPE i,
- lv_index TYPE i,
- lv_align_flag TYPE c.
+ lt_colors TYPE zexcel_t_style_color_argb,
+ ls_color LIKE LINE OF lt_colors.
+
+ 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,
+ lv_cellxfs_count TYPE i,
+ lv_index TYPE i,
+ lv_align_flag TYPE c.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
@@ -5055,112 +5261,112 @@ ENDMETHOD.
lo_element_fill = lo_document->create_simple_element( name = lc_xml_node_fill
parent = lo_document ).
- if ls_fill-gradtype is not initial.
- "gradient
+ IF ls_fill-gradtype IS NOT INITIAL.
+ "gradient
- lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_gradientfill
- parent = lo_document ).
- if ls_fill-gradtype-degree is not initial.
- lv_value = ls_fill-gradtype-degree.
- lo_sub_element->set_attribute_ns( name = lc_xml_attr_degree value = lv_value ).
- endif.
- if ls_fill-gradtype-type is not initial.
- lv_value = ls_fill-gradtype-type.
- lo_sub_element->set_attribute_ns( name = lc_xml_attr_type value = lv_value ).
- endif.
- if ls_fill-gradtype-bottom is not initial.
- lv_value = ls_fill-gradtype-bottom.
- lo_sub_element->set_attribute_ns( name = lc_xml_attr_bottom value = lv_value ).
- endif.
- if ls_fill-gradtype-top is not initial.
- lv_value = ls_fill-gradtype-top.
- lo_sub_element->set_attribute_ns( name = lc_xml_attr_top value = lv_value ).
- endif.
- if ls_fill-gradtype-right is not initial.
- lv_value = ls_fill-gradtype-right.
- lo_sub_element->set_attribute_ns( name = lc_xml_attr_right value = lv_value ).
- endif.
- if ls_fill-gradtype-left is not initial.
- lv_value = ls_fill-gradtype-left.
- lo_sub_element->set_attribute_ns( name = lc_xml_attr_left value = lv_value ).
- endif.
+ lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_gradientfill
+ parent = lo_document ).
+ IF ls_fill-gradtype-degree IS NOT INITIAL.
+ lv_value = ls_fill-gradtype-degree.
+ lo_sub_element->set_attribute_ns( name = lc_xml_attr_degree value = lv_value ).
+ ENDIF.
+ IF ls_fill-gradtype-type IS NOT INITIAL.
+ lv_value = ls_fill-gradtype-type.
+ lo_sub_element->set_attribute_ns( name = lc_xml_attr_type value = lv_value ).
+ ENDIF.
+ IF ls_fill-gradtype-bottom IS NOT INITIAL.
+ lv_value = ls_fill-gradtype-bottom.
+ lo_sub_element->set_attribute_ns( name = lc_xml_attr_bottom value = lv_value ).
+ ENDIF.
+ IF ls_fill-gradtype-top IS NOT INITIAL.
+ lv_value = ls_fill-gradtype-top.
+ lo_sub_element->set_attribute_ns( name = lc_xml_attr_top value = lv_value ).
+ ENDIF.
+ IF ls_fill-gradtype-right IS NOT INITIAL.
+ lv_value = ls_fill-gradtype-right.
+ lo_sub_element->set_attribute_ns( name = lc_xml_attr_right value = lv_value ).
+ ENDIF.
+ IF ls_fill-gradtype-left IS NOT INITIAL.
+ lv_value = ls_fill-gradtype-left.
+ lo_sub_element->set_attribute_ns( name = lc_xml_attr_left value = lv_value ).
+ ENDIF.
- if ls_fill-gradtype-position3 is not initial.
- "create <stop> elements for gradients, we can have 2 or 3 stops in each gradient
- lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
- parent = lo_sub_element ).
- lv_value = ls_fill-gradtype-position1.
- lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position value = lv_value ).
+ IF ls_fill-gradtype-position3 IS NOT INITIAL.
+ "create <stop> elements for gradients, we can have 2 or 3 stops in each gradient
+ lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
+ parent = lo_sub_element ).
+ lv_value = ls_fill-gradtype-position1.
+ lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position value = lv_value ).
- 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_color ).
- lo_sub_element->append_child( new_child = lo_sub_element_2 ).
+ 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_color ).
+ lo_sub_element->append_child( new_child = lo_sub_element_2 ).
- lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
- parent = lo_sub_element ).
+ lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
+ parent = lo_sub_element ).
- lv_value = ls_fill-gradtype-position2.
+ lv_value = ls_fill-gradtype-position2.
- lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position
- value = lv_value ).
+ lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position
+ value = lv_value ).
- 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_color ).
- lo_sub_element->append_child( new_child = lo_sub_element_2 ).
+ 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_color ).
+ lo_sub_element->append_child( new_child = lo_sub_element_2 ).
- lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
- parent = lo_sub_element ).
+ lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
+ parent = lo_sub_element ).
- lv_value = ls_fill-gradtype-position3.
- lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position
- value = lv_value ).
+ lv_value = ls_fill-gradtype-position3.
+ lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position
+ value = lv_value ).
- 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_color ).
- lo_sub_element->append_child( new_child = lo_sub_element_2 ).
+ 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_color ).
+ lo_sub_element->append_child( new_child = lo_sub_element_2 ).
- else.
- "create <stop> elements for gradients, we can have 2 or 3 stops in each gradient
- lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
- parent = lo_sub_element ).
- lv_value = ls_fill-gradtype-position1.
- lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position value = lv_value ).
+ ELSE.
+ "create <stop> elements for gradients, we can have 2 or 3 stops in each gradient
+ lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
+ parent = lo_sub_element ).
+ lv_value = ls_fill-gradtype-position1.
+ lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position value = lv_value ).
- 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_color ).
- lo_sub_element->append_child( new_child = lo_sub_element_2 ).
+ 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_color ).
+ lo_sub_element->append_child( new_child = lo_sub_element_2 ).
- lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
- parent = lo_sub_element ).
+ lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
+ parent = lo_sub_element ).
- lv_value = ls_fill-gradtype-position2.
- lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position
- value = lv_value ).
+ lv_value = ls_fill-gradtype-position2.
+ lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position
+ value = lv_value ).
- 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_color ).
- lo_sub_element->append_child( new_child = lo_sub_element_2 ).
- endif.
+ 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_color ).
+ lo_sub_element->append_child( new_child = lo_sub_element_2 ).
+ ENDIF.
- else.
+ ELSE.
"pattern
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_patternfill
parent = lo_document ).
@@ -5187,7 +5393,7 @@ ENDMETHOD.
iv_color_elem_name = lc_xml_node_bgcolor ).
ENDIF.
- endif.
+ ENDIF.
lo_element_fill->append_child( new_child = lo_sub_element )."pattern
lo_element_fills->append_child( new_child = lo_element_fill ).
@@ -5508,176 +5714,54 @@ ENDMETHOD.
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.
+* begin of change issue #366 - missing conditional rules: top10, move dfx-styles to own method
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
+ me->create_dxf_style( EXPORTING
+ iv_cell_style = lo_style_conditional->mode_cellis-cell_style
+ io_dxf_element = lo_element
+ io_ixml_document = lo_document
+ it_cellxfs = lt_cellxfs
+ it_fonts = lt_fonts
+ it_fills = lt_fills
+ CHANGING
+ cv_dfx_count = lv_dfx_count ).
- " Style already mapped?
- READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY style = ls_styles_mapping-style.
- IF sy-subrc EQ 0.
- ls_style_cond_mapping-guid = ls_cellis-cell_style.
- APPEND ls_style_cond_mapping TO me->styles_cond_mapping.
- ELSE.
- ls_style_cond_mapping-guid = ls_cellis-cell_style.
- ls_style_cond_mapping-style = ls_styles_mapping-style.
- ls_style_cond_mapping-dxf = 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 ).
-
- "Conditional formatting font style correction by Alessandro Iannacci START
- lv_index = ls_cellxfs-fontid + 1.
- READ TABLE lt_fonts INTO ls_font INDEX lv_index.
- IF ls_font IS NOT INITIAL.
- lo_element_font = lo_document->create_simple_element( name = lc_xml_node_font
- parent = lo_document ).
- IF ls_font-bold EQ abap_true.
- lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_b
- parent = lo_document ).
- lo_element_font->append_child( new_child = lo_sub_element_2 ).
- ENDIF.
- IF ls_font-italic EQ abap_true.
- lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_i
- parent = lo_document ).
- lo_element_font->append_child( new_child = lo_sub_element_2 ).
- ENDIF.
- IF ls_font-underline EQ abap_true.
- lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_u
- parent = lo_document ).
- lv_value = ls_font-underline_mode.
- lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_val
- value = lv_value ).
- lo_element_font->append_child( new_child = lo_sub_element_2 ).
- ENDIF.
- IF ls_font-strikethrough EQ abap_true.
- lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_strike
- parent = lo_document ).
- lo_element_font->append_child( new_child = lo_sub_element_2 ).
- ENDIF.
- "color
- create_xl_styles_color_node(
- io_document = lo_document
- io_parent = lo_element_font
- is_color = ls_font-color ).
- lo_sub_element->append_child( new_child = lo_element_font ).
- ENDIF.
- "---Conditional formatting font style correction by Alessandro Iannacci END
-
-
- 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 ).
-
- IF ls_fill-fgcolor-rgb IS INITIAL AND
- ls_fill-fgcolor-indexed EQ zcl_excel_style_color=>c_indexed_not_set AND
- ls_fill-fgcolor-theme EQ zcl_excel_style_color=>c_theme_not_set AND
- ls_fill-fgcolor-tint IS INITIAL AND ls_fill-bgcolor-indexed EQ zcl_excel_style_color=>c_indexed_sys_foreground.
-
- " 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 ).
-
- ENDIF.
-
- lo_element_fill->append_child( new_child = lo_sub_element_2 ). "pattern
-
- lo_sub_element->append_child( new_child = lo_element_fill ).
- ENDIF.
- ENDIF.
-
- lo_element->append_child( new_child = lo_sub_element ).
WHEN zcl_excel_style_conditional=>c_rule_expression.
- "if style defined
- ls_expression = lo_style_conditional->mode_expression.
- IF ls_expression-cell_style IS INITIAL.
- CONTINUE.
- ENDIF.
- READ TABLE me->styles_mapping INTO ls_styles_mapping WITH KEY guid = ls_expression-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
+ me->create_dxf_style( EXPORTING
+ iv_cell_style = lo_style_conditional->mode_expression-cell_style
+ io_dxf_element = lo_element
+ io_ixml_document = lo_document
+ it_cellxfs = lt_cellxfs
+ it_fonts = lt_fonts
+ it_fills = lt_fills
+ CHANGING
+ cv_dfx_count = lv_dfx_count ).
- READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY style = ls_styles_mapping-style.
- IF sy-subrc EQ 0.
- ls_style_cond_mapping-guid = ls_expression-cell_style.
- APPEND ls_style_cond_mapping TO me->styles_cond_mapping.
- ELSE.
- ls_style_cond_mapping-guid = ls_expression-cell_style.
- ls_style_cond_mapping-style = ls_styles_mapping-style.
- ls_style_cond_mapping-dxf = 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 ).
+ WHEN zcl_excel_style_conditional=>c_rule_top10.
+ me->create_dxf_style( EXPORTING
+ iv_cell_style = lo_style_conditional->mode_top10-cell_style
+ io_dxf_element = lo_element
+ io_ixml_document = lo_document
+ it_cellxfs = lt_cellxfs
+ it_fonts = lt_fonts
+ it_fills = lt_fills
+ CHANGING
+ cv_dfx_count = lv_dfx_count ).
- IF ls_fill-fgcolor-rgb IS INITIAL AND
- ls_fill-fgcolor-indexed EQ zcl_excel_style_color=>c_indexed_not_set AND
- ls_fill-fgcolor-theme EQ zcl_excel_style_color=>c_theme_not_set AND
- ls_fill-fgcolor-tint IS INITIAL AND ls_fill-bgcolor-indexed EQ zcl_excel_style_color=>c_indexed_sys_foreground.
+ WHEN zcl_excel_style_conditional=>c_rule_above_average.
+ me->create_dxf_style( EXPORTING
+ iv_cell_style = lo_style_conditional->mode_above_average-cell_style
+ io_dxf_element = lo_element
+ io_ixml_document = lo_document
+ it_cellxfs = lt_cellxfs
+ it_fonts = lt_fonts
+ it_fills = lt_fills
+ CHANGING
+ cv_dfx_count = lv_dfx_count ).
+* begin of change issue #366 - missing conditional rules: top10, move dfx-styles to own method
- " 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 ).
-
- ENDIF.
-
- lo_element_fill->append_child( new_child = lo_sub_element_2 ). "pattern
-
- lo_sub_element->append_child( new_child = lo_element_fill ).
- ENDIF.
- ENDIF.
-
- lo_element->append_child( new_child = lo_sub_element ).
WHEN OTHERS.
CONTINUE.
ENDCASE.
diff --git a/ZA2X/TABL/ZEXCEL_CONDITIONAL_ABOVE_AVG.slnk b/ZA2X/TABL/ZEXCEL_CONDITIONAL_ABOVE_AVG.slnk
new file mode 100644
index 0000000..756dd7a
--- /dev/null
+++ b/ZA2X/TABL/ZEXCEL_CONDITIONAL_ABOVE_AVG.slnk
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/ZA2X/TABL/ZEXCEL_CONDITIONAL_CELLIS.slnk b/ZA2X/TABL/ZEXCEL_CONDITIONAL_CELLIS.slnk
index 082dad3..94cf2da 100644
--- a/ZA2X/TABL/ZEXCEL_CONDITIONAL_CELLIS.slnk
+++ b/ZA2X/TABL/ZEXCEL_CONDITIONAL_CELLIS.slnk
@@ -2,6 +2,7 @@
-
-
+
+
+
diff --git a/ZA2X/TABL/ZEXCEL_CONDITIONAL_TOP10.slnk b/ZA2X/TABL/ZEXCEL_CONDITIONAL_TOP10.slnk
new file mode 100644
index 0000000..c554a9c
--- /dev/null
+++ b/ZA2X/TABL/ZEXCEL_CONDITIONAL_TOP10.slnk
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+