From 9cd2c62ca5ce4d7db2498a967124b066ac073ccf Mon Sep 17 00:00:00 2001 From: Ivan Femia Date: Thu, 12 May 2011 19:33:25 +0000 Subject: [PATCH] Enhancement to border style. DEMO2 update git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@177 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049 --- ZA2X/CLAS/ZCL_EXCEL_STYLE_BORDER.slnk | 36 +++++++-------- ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk | 17 +++++++ ZA2X/PROG/ZDEMO_EXCEL2.slnk | 10 +++-- ZA2X/TABL/ZEXCEL_S_STYLE_BORDER.slnk | 64 ++++++++++++++------------- ZA2X/TTYP/ZEXCEL_T_STYLE_BORDER.slnk | 22 ++++----- 5 files changed, 86 insertions(+), 63 deletions(-) diff --git a/ZA2X/CLAS/ZCL_EXCEL_STYLE_BORDER.slnk b/ZA2X/CLAS/ZCL_EXCEL_STYLE_BORDER.slnk index 39f1868..d46ae32 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_STYLE_BORDER.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_STYLE_BORDER.slnk @@ -1,5 +1,5 @@ - + class ZCL_EXCEL_STYLE_BORDER definition public final @@ -41,23 +41,23 @@ 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. border_style = zcl_excel_style_border=>c_border_none. border_color-theme = zcl_excel_style_color=>c_theme_not_set. diff --git a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk index 0c0c30d..4cf1511 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_WRITER_2007.slnk @@ -2992,6 +2992,8 @@ endmethod. lc_xml_attr_indent TYPE string VALUE 'indent', lc_xml_attr_locked TYPE string VALUE 'locked', lc_xml_attr_hidden TYPE string VALUE 'hidden', + lc_xml_attr_diagonalUp TYPE string VALUE 'diagonalUp', + lc_xml_attr_diagonalDown TYPE string VALUE 'diagonalDown', " Node namespace lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'. @@ -3312,6 +3314,21 @@ endmethod. LOOP AT lt_borders INTO ls_border. lo_element_border = lo_document->create_simple_element( name = lc_xml_node_border parent = lo_document ). + + IF ls_border-diagonalup IS NOT INITIAL. + lv_value = ls_border-diagonalup. + CONDENSE lv_value. + lo_element_border->set_attribute_ns( name = lc_xml_attr_diagonalup + value = lv_value ). + ENDIF. + + IF ls_border-diagonaldown IS NOT INITIAL. + lv_value = ls_border-diagonaldown. + CONDENSE lv_value. + lo_element_border->set_attribute_ns( name = lc_xml_attr_diagonaldown + value = lv_value ). + ENDIF. + "left lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_left parent = lo_document ). diff --git a/ZA2X/PROG/ZDEMO_EXCEL2.slnk b/ZA2X/PROG/ZDEMO_EXCEL2.slnk index 45b4d25..8992ab6 100644 --- a/ZA2X/PROG/ZDEMO_EXCEL2.slnk +++ b/ZA2X/PROG/ZDEMO_EXCEL2.slnk @@ -1,5 +1,5 @@ - + @@ -99,9 +99,11 @@ START-OF-SELECTION. lo_style_button->borders->top = lo_border_light. lv_style_button_guid = lo_style_button->get_guid( ). "Create style with border - lo_style_border = lo_excel->add_new_style( ). - lo_style_border->borders->allborders = lo_border_dark. - lv_style_border_guid = lo_style_border->get_guid( ). + lo_style_border = lo_excel->add_new_style( ). + lo_style_border->borders->allborders = lo_border_dark. + lo_style_border->borders->diagonal = lo_border_dark. + lo_style_border->borders->diagonal_mode = zcl_excel_style_borders=>c_diagonal_both. + lv_style_border_guid = lo_style_border->get_guid( ). " Create filled style green lo_style_filled = lo_excel->add_new_style( ). lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid. diff --git a/ZA2X/TABL/ZEXCEL_S_STYLE_BORDER.slnk b/ZA2X/TABL/ZEXCEL_S_STYLE_BORDER.slnk index 0fc3a53..41669ab 100644 --- a/ZA2X/TABL/ZEXCEL_S_STYLE_BORDER.slnk +++ b/ZA2X/TABL/ZEXCEL_S_STYLE_BORDER.slnk @@ -1,34 +1,36 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ZA2X/TTYP/ZEXCEL_T_STYLE_BORDER.slnk b/ZA2X/TTYP/ZEXCEL_T_STYLE_BORDER.slnk index 89c9273..0dc3848 100644 --- a/ZA2X/TTYP/ZEXCEL_T_STYLE_BORDER.slnk +++ b/ZA2X/TTYP/ZEXCEL_T_STYLE_BORDER.slnk @@ -1,13 +1,15 @@ - + - - - - - - - - - + + + + + + + + + + +