Thanks to @Gh14Cc10
This commit is contained in:
Ivan Femia 2017-11-15 17:02:11 +01:00
parent 5e6bb3ba10
commit e71644d487
5 changed files with 75 additions and 30 deletions

View File

@ -4,9 +4,6 @@
<asx:values> <asx:values>
<DEVC> <DEVC>
<CTEXT>Spreadsheet libraries</CTEXT> <CTEXT>Spreadsheet libraries</CTEXT>
<PDEVCLASS>ZTIR</PDEVCLASS>
<TRANSLATION_DEPTH>NOT_CLASSIFIED</TRANSLATION_DEPTH>
<TRANSLATION_DEPTH_TEXT>Not Classified</TRANSLATION_DEPTH_TEXT>
</DEVC> </DEVC>
<PERMISSION> <PERMISSION>
<SCOMPPDTLN> <SCOMPPDTLN>

View File

@ -331,7 +331,7 @@ method GET_WIDTH_EMU_STR.
endmethod. endmethod.
method LOAD_CHART_ATTRIBUTES. METHOD load_chart_attributes.
DATA: node TYPE REF TO if_ixml_element. DATA: node TYPE REF TO if_ixml_element.
DATA: node2 TYPE REF TO if_ixml_element. DATA: node2 TYPE REF TO if_ixml_element.
DATA: node3 TYPE REF TO if_ixml_element. DATA: node3 TYPE REF TO if_ixml_element.
@ -424,6 +424,15 @@ method LOAD_CHART_ATTRIBUTES.
zcl_excel_reader_2007=>fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ). zcl_excel_reader_2007=>fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
me->graph->ns_styleval = ls_prop-val. me->graph->ns_styleval = ls_prop-val.
"---------------------------Read graph properties "---------------------------Read graph properties
"ADDED
CLEAR node2.
node2 ?= node->find_from_name( name = 'title' namespace = 'c' ).
IF node2 IS BOUND AND node2 IS NOT INITIAL.
node3 ?= node2->find_from_name( name = 't' namespace = 'a' ).
me->graph->title = node3->get_value( ).
ENDIF.
"END
node2 ?= node->find_from_name( name = 'autoTitleDeleted' namespace = 'c' ). node2 ?= node->find_from_name( name = 'autoTitleDeleted' namespace = 'c' ).
zcl_excel_reader_2007=>fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ). zcl_excel_reader_2007=>fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
me->graph->ns_autotitledeletedval = ls_prop-val. me->graph->ns_autotitledeletedval = ls_prop-val.
@ -814,12 +823,12 @@ method LOAD_CHART_ATTRIBUTES.
lo_linechart->ns_showbubblesizeval = ls_prop-val. lo_linechart->ns_showbubblesizeval = ls_prop-val.
node ?= node->find_from_name( name = 'lineChart' namespace = 'c' ). node ?= node->find_from_name( name = 'lineChart' namespace = 'c' ).
node2 ?= node->find_from_name( name = 'marker' namespace = 'c' DEPTH = '1' ). node2 ?= node->find_from_name( name = 'marker' namespace = 'c' depth = '1' ).
zcl_excel_reader_2007=>fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ). zcl_excel_reader_2007=>fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_linechart->NS_MARKERVAL = ls_prop-val. lo_linechart->ns_markerval = ls_prop-val.
node2 ?= node->find_from_name( name = 'smooth' namespace = 'c' DEPTH = '1' ). node2 ?= node->find_from_name( name = 'smooth' namespace = 'c' depth = '1' ).
zcl_excel_reader_2007=>fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ). zcl_excel_reader_2007=>fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_linechart->NS_SMOOTHVAL = ls_prop-val. lo_linechart->ns_smoothval = ls_prop-val.
node ?= ip_chart->if_ixml_node~get_first_child( ). node ?= ip_chart->if_ixml_node~get_first_child( ).
CHECK node IS NOT INITIAL. CHECK node IS NOT INITIAL.
@ -1008,7 +1017,7 @@ method LOAD_CHART_ATTRIBUTES.
me->graph->pagemargins = ls_pagemargins. me->graph->pagemargins = ls_pagemargins.
endmethod. ENDMETHOD.
method PIXEL2EMU. method PIXEL2EMU.

View File

@ -34,18 +34,19 @@ public section.
footer TYPE string, footer TYPE string,
END OF s_pagemargins . END OF s_pagemargins .
data NS_1904VAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . " . data NS_1904VAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . . . . . " .
data NS_LANGVAL type STRING value 'it-IT'. "#EC NOTEXT . . . . . . . . . . " . data NS_LANGVAL type STRING value 'it-IT'. "#EC NOTEXT . . . . . . . . . . . . . . " .
data NS_ROUNDEDCORNERSVAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . " . data NS_ROUNDEDCORNERSVAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . . . . . " .
data PAGEMARGINS type S_PAGEMARGINS . data PAGEMARGINS type S_PAGEMARGINS .
data NS_AUTOTITLEDELETEDVAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . " . data NS_AUTOTITLEDELETEDVAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . . . . . " .
data NS_PLOTVISONLYVAL type STRING value '1'. "#EC NOTEXT . . . . . . . . . . " . data NS_PLOTVISONLYVAL type STRING value '1'. "#EC NOTEXT . . . . . . . . . . . . . . " .
data NS_DISPBLANKSASVAL type STRING value 'gap'. "#EC NOTEXT . . . . . . . . . . " . data NS_DISPBLANKSASVAL type STRING value 'gap'. "#EC NOTEXT . . . . . . . . . . . . . . " .
data NS_SHOWDLBLSOVERMAXVAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . " . data NS_SHOWDLBLSOVERMAXVAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . . . . . " .
data TITLE type STRING . . . " .
data SERIES type T_SERIES . data SERIES type T_SERIES .
data NS_C14STYLEVAL type STRING value '102'. "#EC NOTEXT . . . . . . . . . . " . data NS_C14STYLEVAL type STRING value '102'. "#EC NOTEXT . . . . . . . . . . . . . . " .
data PRINT_LABEL type C value 'X'. "#EC NOTEXT . . . . . . . . . . " . data PRINT_LABEL type C value 'X'. "#EC NOTEXT . . . . . . . . . . . . . . " .
data NS_STYLEVAL type STRING value '2'. "#EC NOTEXT . . . . . . . . . . " . data NS_STYLEVAL type STRING value '2'. "#EC NOTEXT . . . . . . . . . . . . . . " .
constants: constants:
BEGIN OF c_style_default, BEGIN OF c_style_default,
c14style type i value 102, c14style type i value 102,
@ -317,6 +318,9 @@ public section.
methods SET_PRINT_LBL methods SET_PRINT_LBL
importing importing
!IP_VALUE type C . !IP_VALUE type C .
methods SET_TITLE
importing
value(IP_VALUE) type STRING .
protected section. protected section.
*"* protected components of class ZCL_EXCEL_GRAPH *"* protected components of class ZCL_EXCEL_GRAPH
*"* do not include other source files here!!! *"* do not include other source files here!!!
@ -398,4 +402,9 @@ method SET_STYLE.
me->ns_styleval = ip_style-cstyle. me->ns_styleval = ip_style-cstyle.
CONDENSE me->ns_styleval NO-GAPS. CONDENSE me->ns_styleval NO-GAPS.
endmethod. endmethod.
method SET_TITLE.
me->title = ip_value.
endmethod.
ENDCLASS. ENDCLASS.

View File

@ -1225,7 +1225,7 @@ method CREATE_RELATIONSHIPS.
endmethod. endmethod.
method CREATE_XL_CHARTS. METHOD create_xl_charts.
** Constant node name ** Constant node name
@ -1444,6 +1444,35 @@ method CREATE_XL_CHARTS.
"---------------------------CHART "---------------------------CHART
lo_element = lo_document->create_simple_element( name = lc_xml_node_chart lo_element = lo_document->create_simple_element( name = lc_xml_node_chart
parent = lo_element_root ). parent = lo_element_root ).
"Added
IF lo_chart->title IS NOT INITIAL.
lo_element2 = lo_document->create_simple_element( name = 'c:title'
parent = lo_element ).
lo_element3 = lo_document->create_simple_element( name = 'c:tx'
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = 'c:rich'
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = 'a:bodyPr'
parent = lo_element4 ).
lo_element5 = lo_document->create_simple_element( name = 'a:lstStyle'
parent = lo_element4 ).
lo_element5 = lo_document->create_simple_element( name = 'a:p'
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = 'a:pPr'
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = 'a:defRPr'
parent = lo_element6 ).
lo_element6 = lo_document->create_simple_element( name = 'a:r'
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = 'a:rPr'
parent = lo_element6 ).
lo_element7->set_attribute_ns( name = 'lang'
value = 'en-US' ).
lo_element7 = lo_document->create_simple_element( name = 'a:t'
parent = lo_element6 ).
lo_element7->set_value( value = lo_chart->title ).
ENDIF.
"End
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_autotitledeleted lo_element2 = lo_document->create_simple_element( name = lc_xml_node_autotitledeleted
parent = lo_element ). parent = lo_element ).
lo_element2->set_attribute_ns( name = 'val' lo_element2->set_attribute_ns( name = 'val'
@ -1883,11 +1912,11 @@ method CREATE_XL_CHARTS.
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_marker lo_element4 = lo_document->create_simple_element( name = lc_xml_node_marker
parent = lo_element3 ). parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val' lo_element4->set_attribute_ns( name = 'val'
value = lo_chartl->NS_MARKERVAL ). value = lo_chartl->ns_markerval ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_smooth lo_element4 = lo_document->create_simple_element( name = lc_xml_node_smooth
parent = lo_element3 ). parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val' lo_element4->set_attribute_ns( name = 'val'
value = lo_chartl->NS_SMOOTHVAL ). value = lo_chartl->ns_smoothval ).
"axes "axes
lo_el_rootchart = lo_element3. lo_el_rootchart = lo_element3.
@ -2130,7 +2159,7 @@ method CREATE_XL_CHARTS.
lo_renderer = lo_ixml->create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer = lo_ixml->create_renderer( ostream = lo_ostream document = lo_document ).
lo_renderer->render( ). lo_renderer->render( ).
endmethod. ENDMETHOD.
method CREATE_XL_DRAWINGS. method CREATE_XL_DRAWINGS.

View File

@ -113,6 +113,7 @@ START-OF-SELECTION.
" Set style " Set style
lo_bar1->set_style( zcl_excel_graph=>c_style_default ). lo_bar1->set_style( zcl_excel_graph=>c_style_default ).
lo_bar1->set_title( ip_value = 'TITLE!' ).
" Set label to none " Set label to none
lo_bar1->set_print_lbl( zcl_excel_graph_bars=>c_show_false ). lo_bar1->set_print_lbl( zcl_excel_graph_bars=>c_show_false ).