From 011b88692b54fed59290d92353d79a2e73874dfa Mon Sep 17 00:00:00 2001 From: Gregor Wolf Date: Fri, 13 Jan 2012 06:34:08 +0000 Subject: [PATCH] Ready to test #128, thank you Alexander Budeyev the Patch worked. git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@249 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049 --- ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk | 140 +++++++++++++-------------- ZA2X/PROG/ZDEMO_EXCEL23.slnk | 22 ++++- 2 files changed, 89 insertions(+), 73 deletions(-) diff --git a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk index 2b7efd1..49ec761 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 . @@ -120,33 +120,33 @@ public 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 ZIF_EXCEL_WRITER~WRITE_FILE. me->excel = io_excel. ep_file = me->create( ). endmethod. - - + + method CREATE. @@ -316,8 +316,8 @@ endmethod. endmethod. - - + + method CREATE_CONTENT_TYPES. @@ -571,8 +571,8 @@ endmethod. endmethod. - - + + method CREATE_DOCPROPS_APP. @@ -794,8 +794,8 @@ endmethod. endmethod. - - + + method CREATE_DOCPROPS_CORE. @@ -919,8 +919,8 @@ endmethod. endmethod. - - + + method CREATE_RELATIONSHIPS. @@ -1018,9 +1018,9 @@ endmethod. endmethod. - - - + + + method CREATE_XL_DRAWINGS. @@ -1248,9 +1248,9 @@ endmethod. endmethod. - - - + + + method CREATE_XL_DRAWINGS_RELS. ** Constant node name @@ -1334,8 +1334,8 @@ endmethod. endmethod. - - + + method CREATE_XL_RELATIONSHIPS. @@ -1482,8 +1482,8 @@ endmethod. endmethod. - - + + method CREATE_XL_SHAREDSTRINGS. @@ -1599,10 +1599,10 @@ endmethod. endmethod. - - - - + + + + method CREATE_XL_SHEET. TYPES: BEGIN OF cfvo, @@ -2674,7 +2674,7 @@ endmethod. " PrintOptions IF io_worksheet->print_gridlines = abap_true OR io_worksheet->sheet_setup->vertical_centered = abap_true OR - io_worksheet->sheet_setup->vertical_centered = abap_true. + io_worksheet->sheet_setup->horizontal_centered = abap_true. lo_element = lo_document->create_simple_element( name = 'printOptions' parent = lo_document ). @@ -2903,10 +2903,10 @@ endmethod. endmethod. - - - - + + + + method CREATE_XL_SHEET_RELS. @@ -3048,8 +3048,8 @@ endmethod. endmethod. - - + + method CREATE_XL_STYLES. @@ -3953,11 +3953,11 @@ endmethod. endmethod. - - - - - + + + + + method CREATE_XL_STYLES_COLOR_NODE. DATA: lo_sub_element TYPE REF TO if_ixml_element, lv_value TYPE string. @@ -4004,9 +4004,9 @@ endmethod. io_parent->append_child( new_child = lo_sub_element ). endmethod. - - - + + + method CREATE_XL_TABLE. DATA: lc_xml_node_table TYPE string VALUE 'table', @@ -4175,8 +4175,8 @@ endmethod. endmethod. - - + + method CREATE_XL_THEME. @@ -4264,8 +4264,8 @@ endmethod. endmethod. - - + + method CREATE_XL_WORKBOOK. @@ -4492,9 +4492,9 @@ endmethod. endmethod. - - - + + + method FLAG2BOOL. @@ -4505,9 +4505,9 @@ endmethod. ENDIF. endmethod. - - - + + + method GET_SHARED_STRING_INDEX. diff --git a/ZA2X/PROG/ZDEMO_EXCEL23.slnk b/ZA2X/PROG/ZDEMO_EXCEL23.slnk index 81a524f..2d4fb9e 100644 --- a/ZA2X/PROG/ZDEMO_EXCEL23.slnk +++ b/ZA2X/PROG/ZDEMO_EXCEL23.slnk @@ -1,5 +1,5 @@ - + @@ -93,13 +93,29 @@ START-OF-SELECTION. lo_worksheet->set_show_gridlines( i_show_gridlines = abap_false ). lo_worksheet->set_print_gridlines( i_print_gridlines = abap_false ). - lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet1!B2' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to the first sheet' ip_hyperlink = lo_hyperlink ). + lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet4!B2' ). + lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to the fourth sheet' ip_hyperlink = lo_hyperlink ). lo_worksheet->zif_excel_sheet_protection~protected = zif_excel_sheet_protection=>c_protected. lo_worksheet->zif_excel_sheet_properties~zoomscale = 170. lo_worksheet->ZIF_EXCEL_SHEET_PROPERTIES~ZOOMSCALE_SHEETLAYOUTVIEW = 150. + " Fourth sheet + lo_worksheet = lo_excel->add_new_worksheet( ). + lo_worksheet->set_title( ip_title = 'Sheet4' ). + lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the fourth sheet with grid lines and print centered ONLY horizontal' ). + lo_worksheet->set_show_gridlines( i_show_gridlines = abap_true ). + + lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet1!B2' ). + lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to the first sheet' ip_hyperlink = lo_hyperlink ). + + lo_worksheet->zif_excel_sheet_protection~protected = zif_excel_sheet_protection=>c_protected. + lo_worksheet->zif_excel_sheet_properties~zoomscale = 150. + lo_worksheet->ZIF_EXCEL_SHEET_PROPERTIES~ZOOMSCALE_NORMAL = 150. + +" lo_worksheet->sheet_setup->vertical_centered = abap_true. + lo_worksheet->sheet_setup->horizontal_centered = abap_true. + CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. lv_file = lo_excel_writer->write_file( io_excel = lo_excel ).