From f050d256d0c6decafc6fb72e42d90bf4a7ee5511 Mon Sep 17 00:00:00 2001 From: Gregor Wolf Date: Sat, 29 Jan 2011 16:10:03 +0000 Subject: [PATCH] Made constant zcl_excel_style_number_format=>c_format_text public to fix issue #61. Demo report ZDEMO_EXCEL22 adjusted to test it. git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@111 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049 --- ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk | 92 ++++++++++---------- ZA2X/PROG/ZDEMO_EXCEL22.slnk | 3 +- 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk b/ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk index 034e888..07e5c3a 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_STYLE_NUMBER_FORMAT.slnk @@ -1,13 +1,13 @@ - + 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_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 @@ -41,6 +41,7 @@ public section. constants C_FORMAT_NUMBER_COMMA_SEP2 type ZEXCEL_NUMBER_FORMAT value '#,##0.00_-'. "#EC NOTEXT constants C_FORMAT_PERCENTAGE type ZEXCEL_NUMBER_FORMAT value '0%'. "#EC NOTEXT constants C_FORMAT_PERCENTAGE_00 type ZEXCEL_NUMBER_FORMAT value '0.00%'. "#EC NOTEXT + constants C_FORMAT_TEXT type ZEXCEL_NUMBER_FORMAT value '@'. "#EC NOTEXT data FORMAT_CODE type ZEXCEL_NUMBER_FORMAT . methods CONSTRUCTOR . @@ -50,12 +51,11 @@ 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 + private section. +*"* private components of class ZCL_EXCEL_STYLE_NUMBER_FORMAT *"* do not include other source files here!!! -private section. - constants C_FORMAT_GENERAL type ZEXCEL_NUMBER_FORMAT value ''. "#EC NOTEXT - constants C_FORMAT_TEXT type ZEXCEL_NUMBER_FORMAT value '@'. "#EC NOTEXT + constants C_FORMAT_GENERAL type ZEXCEL_NUMBER_FORMAT value ''. "#EC NOTEXT *"* local class implementation for public class *"* use this source file for the implementation part of *"* local helper classes @@ -64,50 +64,54 @@ 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/PROG/ZDEMO_EXCEL22.slnk b/ZA2X/PROG/ZDEMO_EXCEL22.slnk index 2fd5197..b35442c 100644 --- a/ZA2X/PROG/ZDEMO_EXCEL22.slnk +++ b/ZA2X/PROG/ZDEMO_EXCEL22.slnk @@ -1,5 +1,5 @@ - + @@ -93,6 +93,7 @@ START-OF-SELECTION. lo_style = lo_excel->add_new_style( ). lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid. lo_style->fill->fgcolor = zcl_excel_style_color=>c_gray. + lo_style->number_format->format_code = zcl_excel_style_number_format=>c_format_text. " Create cell style for display only date field lo_style_date = lo_excel->add_new_style( ).