From 327ef3f5f6d6e7cf1b5f190f5a2bbb63c1ef4297 Mon Sep 17 00:00:00 2001 From: Ivan Femia Date: Wed, 25 Apr 2012 09:27:53 +0000 Subject: [PATCH] Ready to test #151 As for OXML specification value should be a string value - ZCL_EXCEL_WORKSHEET only pretty printer - git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@298 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049 --- ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk | 649 +++++++++++++++-------------- ZA2X/DTEL/ZEXCEL_RANGE_VALUE.slnk | 2 +- 2 files changed, 329 insertions(+), 322 deletions(-) diff --git a/ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk b/ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk index 4f83636..8f9def2 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_WORKSHEET.slnk @@ -1,9 +1,8 @@ - - - - - - + + + + + class ZCL_EXCEL_WORKSHEET definition public final @@ -553,52 +552,60 @@ class lcl_gui_alv_grid definition inheriting from cl_gui_alv_grid. endclass. *"* use this source file for any macro definitions you need *"* in the implementation part of the class + + + + + + + + ABAP SLIS SOI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - METHOD zif_excel_sheet_properties~get_style. + method ZIF_EXCEL_SHEET_PROPERTIES~GET_STYLE. IF zif_excel_sheet_properties~style IS NOT INITIAL. ep_style = zif_excel_sheet_properties~style. ELSE. ep_style = me->excel->get_default_style( ). ENDIF. -ENDMETHOD. +endmethod. method ZIF_EXCEL_SHEET_PROPERTIES~INITIALIZE. @@ -655,35 +662,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. @@ -706,26 +713,26 @@ endmethod. endmethod. - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + method BIND_ALV_OLE2. *--------------------------------------------------------------------* * Method description: @@ -2295,8 +2302,8 @@ endmethod. set country space. * Hier wird nur die korrekte Kommaseparatierung gemacht, wenn die * Zeichen einer -* Zahl enthalten sind. Das ist f#ƒÂ#r Timestamps, die auch ":" enthalten. -* F#ƒÂ#r die +* Zahl enthalten sind. Das ist f#ƒÂ#r Timestamps, die auch ":" enthalten. +* F#ƒÂ#r die * darf keine Kommaseparierung stattfinden. * Changing for correction request - Y6BK041073 if contentsitem-value co '0123456789.,-+E '. @@ -2795,11 +2802,11 @@ endmethod. close_document. endmethod. - - - - - + + + + + method BIND_TABLE. DATA: @@ -2969,12 +2976,12 @@ endmethod. endmethod. - - - - - - METHOD calculate_cell_width. + + + + + + method CALCULATE_CELL_WIDTH. DATA: cell_value TYPE zexcel_cell_value, guid TYPE zexcel_cell_style, stylemapping TYPE zexcel_s_stylemapping. @@ -2996,9 +3003,9 @@ endmethod. ep_width = ep_width * stylemapping-complete_style-font-size / 11. ENDIF. -ENDMETHOD. +endmethod. - + method CALCULATE_COLUMN_WIDTHS. TYPES: BEGIN OF t_auto_size, @@ -3053,7 +3060,7 @@ ENDMETHOD. * ). * " For an easy start we just take the number of characters as the width * width = strlen( cell_value ). -* " Addition to solve issue #120, contribution by Stefan Schm#ƒÂ#cker +* " Addition to solve issue #120, contribution by Stefan Schm#ƒÂ#cker * " Calculate width using Font Size and Font Type * IF cell_style IS BOUND * AND cell_style->font IS BOUND. @@ -3076,107 +3083,107 @@ ENDMETHOD. endmethod. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + method CHANGE_CELL_STYLE. " issue # 139 DATA: stylemapping TYPE zexcel_s_stylemapping, @@ -3474,10 +3481,10 @@ endmethod. endmethod. - - - - + + + + method CONSTRUCTOR. DATA: lv_title TYPE zexcel_sheet_title. @@ -3519,7 +3526,7 @@ endmethod. endmethod. - + method DELETE_MERGE. DELETE sheet_content_merge INDEX 1. @@ -3527,10 +3534,10 @@ endmethod. endmethod. - - - - + + + + method FREEZE_PANES. data: lv_xsplit type i, lv_ysplit type i. @@ -3557,8 +3564,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, @@ -3592,8 +3599,8 @@ endmethod. ENDDO. endmethod. - - + + method GET_ACTIVE_CELL. DATA: lv_active_column TYPE zexcel_cell_column_alpha, @@ -3607,14 +3614,14 @@ endmethod. endmethod. - - - - - - - - + + + + + + + + method GET_CELL. DATA: lv_column TYPE zexcel_cell_column, @@ -3631,7 +3638,7 @@ endmethod. ep_value = ls_sheet_content-cell_value. ep_guid = ls_sheet_content-cell_style. " issue 139 - added this to be used for columnwidth calculation - " Addition to solve issue #120, contribution by Stefan Schm#ƒÂ#cker + " Addition to solve issue #120, contribution by Stefan Schm#ƒÂ#cker DATA: style_iterator TYPE REF TO cl_object_collection_iterator, style TYPE REF TO zcl_excel_style. IF ep_style IS REQUESTED. @@ -3646,11 +3653,11 @@ endmethod. ENDIF. endmethod. - - - - - METHOD get_column_dimension. + + + + + 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 @@ -3671,42 +3678,42 @@ endmethod. r_column_dimension = <fs_column_dimension>-column_dimension. ENDIF. -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'. @@ -3731,14 +3738,14 @@ endmethod. ep_default_excel_date_format = default_excel_date_format. endmethod. - - + + method GET_DEFAULT_ROW_DIMENSION. r_row_dimension = me->default_row_dimension. endmethod. - - + + method GET_DIMENSION_RANGE. me->update_dimension_range( ). @@ -3755,62 +3762,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, @@ -3884,9 +3891,9 @@ endmethod. endmethod. - - - + + + method GET_ROW_DIMENSION. FIELD-SYMBOLS: <fs_row_dimension> LIKE LINE OF row_dimensions. @@ -3906,27 +3913,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. @@ -3937,10 +3944,10 @@ endmethod. ENDIF. endmethod. - - - - + + + + method GET_VALUE_TYPE. DATA: lo_addit TYPE REF TO cl_abap_elemdescr, ls_dfies TYPE dfies, @@ -3994,16 +4001,16 @@ endmethod. endmethod. - - - - - - - - - - + + + + + + + + + + method SET_CELL. DATA: lv_column TYPE zexcel_cell_column, @@ -4215,11 +4222,11 @@ endmethod. endmethod. - - - - - + + + + + method SET_CELL_STYLE. DATA: lv_column TYPE zexcel_cell_column, @@ -4245,12 +4252,12 @@ endmethod. endmethod. - - - - - - METHOD set_column_width. + + + + + + method SET_COLUMN_WIDTH. DATA: column_dimension TYPE REF TO zcl_excel_worksheet_columndime. DATA: width TYPE float. @@ -4279,10 +4286,10 @@ endmethod. column_dimension->set_auto_size( ip_width_autosize ). -ENDMETHOD. +endmethod. - - + + method SET_DEFAULT_EXCEL_DATE_FORMAT. IF ip_default_excel_date_format IS INITIAL. @@ -4294,11 +4301,11 @@ ENDMETHOD. default_excel_date_format = ip_default_excel_date_format. endmethod. - - - - - + + + + + method SET_MERGE. DATA: lv_column_start TYPE zexcel_cell_column, @@ -4335,17 +4342,17 @@ endmethod. endmethod. - - + + method SET_PRINT_GRIDLINES. me->print_gridlines = i_print_gridlines. endmethod. - - - - - METHOD set_row_height. + + + + + method SET_ROW_HEIGHT. DATA: row_dimension TYPE REF TO zcl_excel_worksheet_rowdimensi. DATA: height TYPE float. @@ -4370,27 +4377,27 @@ endmethod. -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, @@ -4447,9 +4454,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, @@ -4483,7 +4490,7 @@ endmethod. me->title = ip_title. endmethod. - + method UPDATE_DIMENSION_RANGE. DATA: ls_sheet_content TYPE zexcel_s_cell_data, diff --git a/ZA2X/DTEL/ZEXCEL_RANGE_VALUE.slnk b/ZA2X/DTEL/ZEXCEL_RANGE_VALUE.slnk index 41f9da8..12e2834 100644 --- a/ZA2X/DTEL/ZEXCEL_RANGE_VALUE.slnk +++ b/ZA2X/DTEL/ZEXCEL_RANGE_VALUE.slnk @@ -1,4 +1,4 @@ - +