From 892d7e7cd08e9e716d39ae060ac5899c8badb58f Mon Sep 17 00:00:00 2001 From: Ivan Femia Date: Sat, 30 Jun 2012 19:49:06 +0000 Subject: [PATCH] ready to test git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@316 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049 --- ZA2X/CLAS/ZCL_EXCEL_CONVERTER.slnk | 415 ++++++------ ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk | 96 +-- ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk | 624 +++++++++---------- ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk | 41 +- 4 files changed, 594 insertions(+), 582 deletions(-) diff --git a/ZA2X/CLAS/ZCL_EXCEL_CONVERTER.slnk b/ZA2X/CLAS/ZCL_EXCEL_CONVERTER.slnk index d1fad17..1c5a211 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_CONVERTER.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_CONVERTER.slnk @@ -1,33 +1,33 @@ - - + - - - - class ZCL_EXCEL_CONVERTER definition public @@ -307,49 +307,38 @@ TYPES: BEGIN OF ts_color_styles, tt_color_styles TYPE HASHED TABLE OF ts_color_styles WITH UNIQUE KEY guid_old fontcolor fillcolor. *"* use this source file for any macro definitions you need *"* in the implementation part of the class - - - - - - - - - - - ABAP SLIS SOI - - - - - - - - - - - - - - - - - - - - - - - - - - METHOD bind_cells. + + + + + + + + + + + + + + + + + + + + + + + + + + method BIND_CELLS. * Do we need subtotals with grouping READ TABLE wt_fieldcatalog TRANSPORTING NO FIELDS WITH KEY is_subtotalled = abap_true. @@ -361,13 +350,13 @@ TYPES: BEGIN OF ts_color_styles, i_col_int = w_col_int ) . ENDIF. -ENDMETHOD. +endmethod. - - - - - method bind_table. + + + + + method BIND_TABLE. data: lt_field_catalog type zexcel_t_fieldcatalog, ls_field_catalog type zexcel_s_fieldcatalog, ls_fcat type zexcel_s_converter_fcat, @@ -429,8 +418,8 @@ ENDMETHOD. endmethod. - - METHOD class_constructor. + + method CLASS_CONSTRUCTOR. DATA: ls_objects TYPE ts_alv_types. * Object CL_GUI_ALV_GRID @@ -452,10 +441,10 @@ endmethod. ls_objects-clsname = 'ZCL_EXCEL_CONVERTER_RESULT_WD'. INSERT ls_objects INTO TABLE wt_objects. -ENDMETHOD. +endmethod. - - METHOD clean_fieldcatalog. + + method CLEAN_FIELDCATALOG. DATA: l_position TYPE int1. FIELD-SYMBOLS: <fs_sfcat> TYPE zexcel_s_converter_fcat. @@ -489,19 +478,19 @@ ENDMETHOD. i_decimals = <fs_sfcat>-decimals ). ENDLOOP. -ENDMETHOD. +endmethod. - - - - - - - - - - - method convert. + + + + + + + + + + + method CONVERT. try. execute_converter( EXPORTING io_object = io_alv @@ -544,11 +533,11 @@ ENDMETHOD. endmethod. - - - - - METHOD create_color_style. + + + + + method CREATE_COLOR_STYLE. DATA: ls_styles TYPE ts_styles. DATA: lo_style TYPE REF TO zcl_excel_style. @@ -567,15 +556,15 @@ endmethod. ro_style = lo_style. ENDIF. -ENDMETHOD. +endmethod. - - - - - - - method create_formular_subtotal. + + + + + + + method CREATE_FORMULAR_SUBTOTAL. data: l_row_alpha_start type string, l_row_alpha_end type string, l_func_num type string. @@ -587,12 +576,12 @@ ENDMETHOD. concatenate 'SUBTOTAL(' l_func_num ',' i_column l_row_alpha_start ':' i_column l_row_alpha_end ')' into r_formula. endmethod. - - - - - - method create_formular_total. + + + + + + method CREATE_FORMULAR_TOTAL. data: l_row_alpha type string, l_row_e_alpha type string. @@ -602,9 +591,9 @@ endmethod. concatenate i_totals_function '(' i_column l_row_alpha ':' i_column l_row_e_alpha ')' into r_formula. endmethod. - - - METHOD create_path. + + + method CREATE_PATH. DATA: l_sep TYPE c , l_path TYPE string, l_return TYPE i . @@ -657,12 +646,12 @@ endmethod. ENDDO. ENDIF. -ENDMETHOD. +endmethod. - - - - method create_style_hdr. + + + + method CREATE_STYLE_HDR. data: lo_style type ref to zcl_excel_style. lo_style = wo_excel->add_new_style( ). @@ -676,12 +665,12 @@ ENDMETHOD. ro_style = lo_style . endmethod. - - - - - - METHOD create_style_normal. + + + + + + method CREATE_STYLE_NORMAL. DATA: lo_style TYPE REF TO zcl_excel_style, l_format TYPE zexcel_number_format. @@ -705,14 +694,14 @@ endmethod. ro_style = lo_style . ENDIF. -ENDMETHOD. +endmethod. - - - - - - method create_style_stripped. + + + + + + method CREATE_STYLE_STRIPPED. data: lo_style type ref to zcl_excel_style. data: l_format type zexcel_number_format. @@ -733,11 +722,11 @@ ENDMETHOD. endmethod. - - - - - + + + + + method CREATE_STYLE_SUBTOTAL. data: lo_style type ref to zcl_excel_style. data: l_format type zexcel_number_format. @@ -760,12 +749,12 @@ endmethod. endmethod. - - - - - - METHOD create_style_total. + + + + + + method CREATE_STYLE_TOTAL. DATA: lo_style TYPE REF TO zcl_excel_style. DATA: l_format TYPE zexcel_number_format. @@ -801,10 +790,10 @@ endmethod. ro_style = lo_style . -ENDMETHOD. +endmethod. - - METHOD create_table. + + method CREATE_TABLE. TYPES: BEGIN OF ts_output, fieldname TYPE fieldname, function TYPE funcname, @@ -864,13 +853,13 @@ ENDMETHOD. ENDIF. ENDIF. -ENDMETHOD. +endmethod. - - - - - method create_text_subtotal. + + + + + method CREATE_TEXT_SUBTOTAL. data: l_string type string, l_func type string. @@ -894,11 +883,11 @@ ENDMETHOD. endmethod. - - - - - METHOD create_worksheet. + + + + + method CREATE_WORKSHEET. DATA: l_freeze_col TYPE i. DATA: l_guid TYPE oltpguid16. @@ -936,13 +925,13 @@ endmethod. ip_num_rows = w_row_int ) . ENDIF. -ENDMETHOD. +endmethod. - - - - - METHOD execute_converter. + + + + + method EXECUTE_CONVERTER. DATA: lt_fieldcatalog TYPE zexcel_t_fieldcatalog, ls_fieldcatalog TYPE zexcel_s_converter_fcat, lo_if TYPE REF TO zif_excel_converter, @@ -985,14 +974,14 @@ ENDMETHOD. GET REFERENCE OF it_table INTO wo_table. ENDIF. -ENDMETHOD. +endmethod. - - - - - - METHOD get_color_style. + + + + + + method GET_COLOR_STYLE. DATA: ls_colors TYPE zexcel_s_converter_col, ls_color_styles TYPE ts_color_styles, lo_style TYPE REF TO zcl_excel_style. @@ -1047,13 +1036,13 @@ ENDMETHOD. r_style = i_style. ENDIF. -ENDMETHOD. +endmethod. - - - - - method get_file. + + + + + method GET_FILE. data: lo_excel_writer type ref to zif_excel_writer, lo_excel type ref to zcl_excel. @@ -1089,10 +1078,10 @@ ENDMETHOD. endmethod. - - - - method get_function_number. + + + + method GET_FUNCTION_NUMBER. *Number Function *1 AVERAGE *2 COUNT @@ -1122,13 +1111,13 @@ endmethod. endcase. endmethod. - - - - - - - METHOD get_style. + + + + + + + method GET_STYLE. DATA: ls_styles TYPE ts_styles, lo_style TYPE REF TO zcl_excel_style. @@ -1172,14 +1161,14 @@ endmethod. INSERT ls_styles INTO TABLE wt_styles. ENDIF. ENDIF. -ENDMETHOD. +endmethod. - - - - - - METHOD loop_normal. + + + + + + method LOOP_NORMAL. DATA: lo_tabdescr TYPE REF TO cl_abap_structdescr, lo_data TYPE REF TO data, l_row_header TYPE zexcel_cell_row VALUE '2', @@ -1290,14 +1279,14 @@ ENDMETHOD. ip_style = <fs_sfcat>-style_total ). ENDIF. ENDLOOP. -ENDMETHOD. +endmethod. - - - - - - METHOD loop_subtotal. + + + + + + method LOOP_SUBTOTAL. DATA: lo_tabdescr TYPE REF TO cl_abap_structdescr, lo_data TYPE REF TO data, @@ -1640,10 +1629,10 @@ ENDMETHOD. ENDIF. ENDLOOP. -ENDMETHOD. +endmethod. - - method open_file. + + method OPEN_FILE. data: l_bytecount type i, lt_file type solix_tab, l_dir type string, @@ -1696,8 +1685,8 @@ ENDMETHOD. endmethod. - - METHOD set_autofilter_area. + + method SET_AUTOFILTER_AREA. DATA: ls_area TYPE zexcel_s_autofilter_area, l_lines TYPE i, lt_values TYPE zexcel_t_autofilter_values, @@ -1720,19 +1709,19 @@ endmethod. wo_autofilter->set_filter_area( is_area = ls_area ) . ENDIF. -ENDMETHOD. +endmethod. - - - - - METHOD set_cell_format. + + + + + method SET_CELL_FORMAT. DATA: l_format TYPE zexcel_number_format. CLEAR r_format. CASE i_inttype. WHEN cl_abap_typedescr=>typekind_date. - r_format = wo_worksheet->get_default_excel_date_format( ). + r_format = zcl_excel_style_number_format=>c_format_date_std. WHEN cl_abap_typedescr=>typekind_time. r_format = zcl_excel_style_number_format=>c_format_date_time6. WHEN cl_abap_typedescr=>typekind_float OR cl_abap_typedescr=>typekind_packed. @@ -1746,10 +1735,10 @@ ENDMETHOD. WHEN cl_abap_typedescr=>typekind_int OR cl_abap_typedescr=>typekind_int1 OR cl_abap_typedescr=>typekind_int2. r_format = '#,##0'. ENDCASE. -ENDMETHOD. +endmethod. - - METHOD set_fieldcatalog. + + method SET_FIELDCATALOG. DATA: lr_data TYPE REF TO data, lo_structdescr TYPE REF TO cl_abap_structdescr, lo_elemdescr TYPE REF TO cl_abap_elemdescr, @@ -1804,11 +1793,11 @@ ENDMETHOD. clean_fieldcatalog( ). -ENDMETHOD. +endmethod. - - - method write_file. + + + method WRITE_FILE. data: l_bytecount type i, lt_file type solix_tab, l_dir type string. diff --git a/ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk b/ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk index 368a073..509557c 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk @@ -1,14 +1,16 @@ - + class ZCL_EXCEL_STYLE_NUMBER_FORMAT definition public final create public . +public section. *"* public components of class ZCL_EXCEL_STYLE_NUMBER_FORMAT *"* do not include other source files here!!! -public section. + constants C_FORMAT_NUMC_STD type ZEXCEL_NUMBER_FORMAT value 'STD_NDEC'. "#EC NOTEXT + constants C_FORMAT_DATE_STD type ZEXCEL_NUMBER_FORMAT value 'STD_DATE'. "#EC NOTEXT constants C_FORMAT_CURRENCY_EUR_SIMPLE type ZEXCEL_NUMBER_FORMAT value '[$EUR ]#,##0.00_-'. "#EC NOTEXT constants C_FORMAT_CURRENCY_USD type ZEXCEL_NUMBER_FORMAT value '$#,##0_-'. "#EC NOTEXT constants C_FORMAT_CURRENCY_USD_SIMPLE type ZEXCEL_NUMBER_FORMAT value '"$"#,##0.00_-'. "#EC NOTEXT @@ -55,9 +57,9 @@ public section. *"* protected components of class ZABAP_EXCEL_STYLE_FONT *"* do not include other source files here!!! protected section. - *"* private components of class ZCL_EXCEL_STYLE_NUMBER_FORMAT -*"* do not include other source files here!!! -private section. + private section. +*"* private components of class ZCL_EXCEL_STYLE_NUMBER_FORMAT +*"* do not include other source files here!!! *"* local class implementation for public class *"* use this source file for the implementation part of *"* local helper classes @@ -66,51 +68,53 @@ 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. format_code = me->c_format_general. endmethod. - - + + method GET_STRUCTURE. ep_number_format-numfmt = me->format_code. endmethod. diff --git a/ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk b/ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk index 9cd6ed7..c19cc84 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk @@ -1,16 +1,16 @@ - - - - + + + + class ZCL_EXCEL_WORKSHEET definition public final create public . +public section. *"* public components of class ZCL_EXCEL_WORKSHEET *"* do not include other source files here!!! -public section. type-pools ABAP . interfaces ZIF_EXCEL_SHEET_PROPERTIES . @@ -570,39 +570,39 @@ endclass. ABAP SLIS SOI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + method ZIF_EXCEL_SHEET_PROPERTIES~GET_STYLE. IF zif_excel_sheet_properties~style IS NOT INITIAL. @@ -667,35 +667,35 @@ endmethod. me->zif_excel_sheet_vba_project~codename_pr = ip_codename_pr. endmethod. - - + + method ADD_DRAWING. drawings->add( ip_drawing ). endmethod. - - + + method ADD_NEW_CONDITIONAL_STYLE. CREATE OBJECT eo_conditional_style. conditional_styles->add( eo_conditional_style ). endmethod. - - + + method ADD_NEW_DATA_VALIDATION. CREATE OBJECT eo_data_validation. data_validations->add( eo_data_validation ). endmethod. - - - - - - - + + + + + + + method BIND_ALV. data: lo_converter type ref to zcl_excel_converter. @@ -718,26 +718,26 @@ endmethod. endmethod. - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + method BIND_ALV_OLE2. *--------------------------------------------------------------------* * Method description: @@ -2807,11 +2807,11 @@ endmethod. close_document. endmethod. - - - - - + + + + + method BIND_TABLE. DATA: @@ -2981,11 +2981,11 @@ endmethod. endmethod. - - - - - + + + + + method CALCULATE_CELL_WIDTH. DATA: cell_value TYPE zexcel_cell_value, guid TYPE zexcel_cell_style, @@ -3010,7 +3010,7 @@ endmethod. endmethod. - + method CALCULATE_COLUMN_WIDTHS. TYPES: BEGIN OF t_auto_size, @@ -3088,107 +3088,107 @@ endmethod. endmethod. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + method CHANGE_CELL_STYLE. " issue # 139 DATA: stylemapping TYPE zexcel_s_stylemapping, @@ -3486,10 +3486,10 @@ endmethod. endmethod. - - - - + + + + method CONSTRUCTOR. DATA: lv_title TYPE zexcel_sheet_title. @@ -3531,7 +3531,7 @@ endmethod. endmethod. - + method DELETE_MERGE. DELETE sheet_content_merge INDEX 1. @@ -3539,10 +3539,10 @@ endmethod. endmethod. - - - - + + + + method FREEZE_PANES. data: lv_xsplit type i, lv_ysplit type i. @@ -3569,8 +3569,8 @@ endmethod. freeze_pane_cell_row = ip_num_rows + 1. endmethod. - - + + method GENERATE_TITLE. DATA: lo_worksheets_iterator TYPE REF TO cl_object_collection_iterator, lo_worksheet TYPE REF TO zcl_excel_worksheet, @@ -3604,8 +3604,8 @@ endmethod. ENDDO. endmethod. - - + + method GET_ACTIVE_CELL. DATA: lv_active_column TYPE zexcel_cell_column_alpha, @@ -3619,14 +3619,14 @@ endmethod. endmethod. - - - - - - - - + + + + + + + + method GET_CELL. DATA: lv_column TYPE zexcel_cell_column, @@ -3658,10 +3658,10 @@ endmethod. ENDIF. endmethod. - - - - + + + + method GET_COLUMN_DIMENSION. FIELD-SYMBOLS: <fs_column_dimension> LIKE LINE OF column_dimensions. DATA: lv_column_alpha TYPE zexcel_cell_column_alpha. " issue #155 - less restrictive typing for ip_column @@ -3685,40 +3685,40 @@ endmethod. endmethod. - - + + method GET_COLUMN_DIMENSIONS. r_column_dimension[] = me->column_dimensions[]. endmethod. - - + + method GET_COND_STYLES_ITERATOR. eo_iterator = me->conditional_styles->get_iterator( ). endmethod. - - + + method GET_DATA_VALIDATIONS_ITERATOR. eo_iterator = me->data_validations->get_iterator( ). endmethod. - - + + method GET_DATA_VALIDATIONS_SIZE. ep_size = me->data_validations->size( ). endmethod. - - + + method GET_DEFAULT_COLUMN_DIMENSION. r_column_dimension = me->default_column_dimension. endmethod. - - + + method GET_DEFAULT_EXCEL_DATE_FORMAT. CONSTANTS: c_lang_e TYPE lang VALUE 'E'. @@ -3743,9 +3743,9 @@ endmethod. ep_default_excel_date_format = default_excel_date_format. endmethod. - - - METHOD get_default_excel_time_format. + + + method GET_DEFAULT_EXCEL_TIME_FORMAT. DATA: l_timefm TYPE xutimefm. IF default_excel_time_format IS NOT INITIAL. @@ -3777,16 +3777,16 @@ endmethod. ENDCASE. ep_default_excel_time_format = default_excel_time_format. -ENDMETHOD. +endmethod. - - + + method GET_DEFAULT_ROW_DIMENSION. r_row_dimension = me->default_row_dimension. endmethod. - - + + method GET_DIMENSION_RANGE. me->update_dimension_range( ). @@ -3804,62 +3804,62 @@ endmethod. endmethod. - - + + method GET_DRAWINGS. r_drawings = drawings. endmethod. - - + + method GET_DRAWINGS_ITERATOR. eo_iterator = drawings->get_iterator( ). endmethod. - - - + + + method GET_FREEZE_CELL. ep_row = me->freeze_pane_cell_row. ep_column = me->freeze_pane_cell_column. endmethod. - - + + method GET_GUID. ep_guid = me->guid. endmethod. - - + + method GET_HIGHEST_COLUMN. me->update_dimension_range( ). r_highest_column = me->lower_cell-cell_column. endmethod. - - + + method GET_HIGHEST_ROW. me->update_dimension_range( ). r_highest_row = me->lower_cell-cell_row. endmethod. - - + + method GET_HYPERLINKS_ITERATOR. eo_iterator = hyperlinks->get_iterator( ). endmethod. - - + + method GET_HYPERLINKS_SIZE. ep_size = hyperlinks->size( ). endmethod. - - + + method GET_MERGE. DATA: lv_column_start TYPE string, @@ -3933,9 +3933,9 @@ endmethod. endmethod. - - - + + + method GET_ROW_DIMENSION. FIELD-SYMBOLS: <fs_row_dimension> LIKE LINE OF row_dimensions. @@ -3955,27 +3955,27 @@ endmethod. endmethod. - - + + method GET_ROW_DIMENSIONS. r_row_dimension[] = me->row_dimensions[]. endmethod. - - + + method GET_TABLES_ITERATOR. eo_iterator = tables->if_object_collection~get_iterator( ). endmethod. - - + + method GET_TABLES_SIZE. ep_size = tables->if_object_collection~size( ). endmethod. - - - + + + method GET_TITLE. DATA lv_value TYPE string. IF ip_escaped EQ abap_true. @@ -3986,10 +3986,10 @@ endmethod. ENDIF. endmethod. - - - - + + + + method GET_VALUE_TYPE. DATA: lo_addit TYPE REF TO cl_abap_elemdescr, ls_dfies TYPE dfies, @@ -4043,16 +4043,16 @@ endmethod. endmethod. - - - - - - - - - - + + + + + + + + + + method SET_CELL. DATA: lv_column TYPE zexcel_cell_column, @@ -4236,7 +4236,7 @@ endmethod. ENDTRY. IF stylemapping-complete_stylex-number_format-format_code IS INITIAL OR stylemapping-complete_style-number_format-format_code IS INITIAL. - lo_format_code_datetime = get_default_excel_date_format( ). + lo_format_code_datetime = zcl_excel_style_number_format=>c_format_date_std. ELSE. lo_format_code_datetime = stylemapping-complete_style-number_format-format_code. ENDIF. @@ -4264,11 +4264,11 @@ endmethod. endmethod. - - - - - + + + + + method SET_CELL_STYLE. DATA: lv_column TYPE zexcel_cell_column, @@ -4294,11 +4294,11 @@ endmethod. endmethod. - - - - - + + + + + method SET_COLUMN_WIDTH. DATA: column_dimension TYPE REF TO zcl_excel_worksheet_columndime. DATA: width TYPE float. @@ -4330,8 +4330,8 @@ endmethod. endmethod. - - + + method SET_DEFAULT_EXCEL_DATE_FORMAT. IF ip_default_excel_date_format IS INITIAL. @@ -4343,11 +4343,11 @@ endmethod. default_excel_date_format = ip_default_excel_date_format. endmethod. - - - - - + + + + + method SET_MERGE. DATA: lv_column_start TYPE zexcel_cell_column, @@ -4384,16 +4384,16 @@ endmethod. endmethod. - - + + method SET_PRINT_GRIDLINES. me->print_gridlines = i_print_gridlines. endmethod. - - - - + + + + method SET_ROW_HEIGHT. DATA: row_dimension TYPE REF TO zcl_excel_worksheet_rowdimensi. DATA: height TYPE float. @@ -4421,25 +4421,25 @@ endmethod. endmethod. - - + + method SET_SHOW_GRIDLINES. me->show_gridlines = i_show_gridlines. endmethod. - - + + method SET_SHOW_ROWCOLHEADERS. me->show_rowcolheaders = i_show_rowcolheaders. endmethod. - - - - - - - + + + + + + + method SET_TABLE. DATA: lo_tabdescr TYPE REF TO cl_abap_structdescr, @@ -4496,9 +4496,9 @@ endmethod. endmethod. - - - + + + method SET_TITLE. DATA: lo_worksheets_iterator TYPE REF TO cl_object_collection_iterator, lo_worksheet TYPE REF TO zcl_excel_worksheet, @@ -4532,7 +4532,7 @@ endmethod. me->title = ip_title. endmethod. - + method UPDATE_DIMENSION_RANGE. DATA: ls_sheet_content TYPE zexcel_s_cell_data, diff --git a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk index 580a3ef..e25019a 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk @@ -3283,7 +3283,7 @@ endmethod. - method CREATE_XL_STYLES. + METHOD create_xl_styles. ** Constant node name @@ -3481,6 +3481,8 @@ endmethod. ls_protection = lo_style->protection->get_structure( ). ls_numfmt = lo_style->number_format->get_structure( ). + + CLEAR ls_cellxfs. @@ -3540,19 +3542,34 @@ endmethod. SUBTRACT 1 FROM ls_cellxfs-protectionid. * Compress number formats - IF ls_numfmt IS NOT INITIAL. - READ TABLE lt_numfmts FROM ls_numfmt TRANSPORTING NO FIELDS. - IF sy-subrc EQ 0. - ls_cellxfs-numfmtid = sy-tabix. + + "----------- + IF ls_numfmt-numfmt NE zcl_excel_style_number_format=>c_format_date_std." and ls_numfmt-NUMFMT ne 'STD_NDEC'. " ALE Changes on going + "--- + IF ls_numfmt IS NOT INITIAL. + + READ TABLE lt_numfmts FROM ls_numfmt TRANSPORTING NO FIELDS. + IF sy-subrc EQ 0. + ls_cellxfs-numfmtid = sy-tabix. + ELSE. + APPEND ls_numfmt TO lt_numfmts. + DESCRIBE TABLE lt_numfmts LINES ls_cellxfs-numfmtid. + ENDIF. + ADD zcl_excel_common=>c_excel_numfmt_offset TO ls_cellxfs-numfmtid. " Add OXML offset for custom styles + ls_cellxfs-applynumberformat = 1. ELSE. - APPEND ls_numfmt TO lt_numfmts. - DESCRIBE TABLE lt_numfmts LINES ls_cellxfs-numfmtid. + ls_cellxfs-applynumberformat = 0. ENDIF. - ADD zcl_excel_common=>c_excel_numfmt_offset TO ls_cellxfs-numfmtid. " Add OXML offset for custom styles - ls_cellxfs-applynumberformat = 1. + "----------- " ALE changes on going ELSE. - ls_cellxfs-applynumberformat = 0. + ls_cellxfs-applynumberformat = 1. + IF ls_numfmt-numfmt EQ zcl_excel_style_number_format=>c_format_date_std. + ls_cellxfs-numfmtid = 14. +* elseif ls_numfmt-NUMFMT eq 'STD_NDEC'. +* ls_cellxfs-numfmtid = 2. + ENDIF. ENDIF. + "--- IF ls_cellxfs-fontid NE 0. ls_cellxfs-applyfont = 1. @@ -3575,6 +3592,8 @@ endmethod. ls_cellxfs-applyborder = 0. ENDIF. + + * Remap styles READ TABLE lt_cellxfs FROM ls_cellxfs TRANSPORTING NO FIELDS. IF sy-subrc EQ 0. @@ -4184,7 +4203,7 @@ endmethod. lo_renderer = lo_ixml->create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer->render( ). -endmethod. +ENDMETHOD.