diff --git a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk index bbc4c44..f835989 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk @@ -1,6 +1,6 @@ - + class ZCL_EXCEL_WRITER_2007 definition public create public . @@ -1180,7 +1180,7 @@ endmethod. lo_element2->set_attribute_ns( name = 'xmlns:c14' value = lc_xml_node_choice_ns_c14 ). - "C14:style + "C14:style lo_element3 = lo_document->create_simple_element( name = lc_xml_node_style parent = lo_element2 ). lo_element3->set_attribute_ns( name = 'val' @@ -1986,7 +1986,11 @@ endmethod. - method CREATE_XL_SHEET. + METHOD create_xl_sheet. +*--------------------------------------------------------------------* +* issue #237 - Error writing column-style +* - Stefan Schmöcker, 2012-11-01 +*--------------------------------------------------------------------* TYPES: BEGIN OF cfvo, value TYPE zexcel_conditional_value, @@ -2209,7 +2213,8 @@ endmethod. lo_autofilter TYPE REF TO zcl_excel_autofilter, l_autofilter_hidden TYPE flag, ls_area TYPE zexcel_s_autofilter_area, - lv_ref TYPE string. + lv_ref TYPE string, + lv_style_index TYPE i. " issue #237 FIELD-SYMBOLS: <ls_sheet_content> TYPE zexcel_s_cell_data, @@ -2574,11 +2579,15 @@ endmethod. " Style * lv_value = <column_dimension>-column_dimension->get_xf_index( ). "del issue #157 - set column style lv_style_guid = <column_dimension>-column_dimension->get_column_style_guid( ). "ins issue #157 - set column style - lv_value = me->excel->get_style_index_in_styles( lv_style_guid ). "ins issue #157 - set column style - SHIFT lv_value RIGHT DELETING TRAILING space. - SHIFT lv_value LEFT DELETING LEADING space. - lo_element_2->set_attribute_ns( name = lc_xml_attr_style - value = lv_value ). +* lv_value = me->excel->get_style_index_in_styles( lv_style_guid ). "del issue #237 + lv_style_index = me->excel->get_style_index_in_styles( lv_style_guid ). "ins issue #237 + IF lv_style_index > 0. "ins issue #237 + lv_value = lv_style_index - 1. "ins issue #237 + SHIFT lv_value RIGHT DELETING TRAILING space. + SHIFT lv_value LEFT DELETING LEADING space. + lo_element_2->set_attribute_ns( name = lc_xml_attr_style + value = lv_value ). + ENDIF. "ins issue #237 lo_element->append_child( new_child = lo_element_2 ). " col node ENDLOOP. @@ -3585,7 +3594,7 @@ endmethod. lo_renderer = lo_ixml->create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer->render( ). -endmethod. +ENDMETHOD.