First Excel Pie Chart directly from ABAP via abap2xlsx

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@379 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
This commit is contained in:
Alessandro Iannacci 2012-12-02 18:11:14 +00:00
parent e7865e58cb
commit e5bff62d2f
5 changed files with 469 additions and 119 deletions

View File

@ -354,10 +354,6 @@ endmethod.</source>
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.
DATA: node4 TYPE REF TO if_ixml_element.
DATA: node5 TYPE REF TO if_ixml_element.
DATA: node6 TYPE REF TO if_ixml_element.
DATA: node7 TYPE REF TO if_ixml_element.
DATA: iterator TYPE REF TO if_ixml_node_iterator. DATA: iterator TYPE REF TO if_ixml_node_iterator.
DATA: chartspace TYPE REF TO if_ixml_node_collection. DATA: chartspace TYPE REF TO if_ixml_node_collection.
@ -367,44 +363,26 @@ endmethod.</source>
DATA lo_barchart TYPE REF TO zcl_excel_graph_bars. DATA lo_barchart TYPE REF TO zcl_excel_graph_bars.
DATA lo_piechart TYPE REF TO zcl_excel_graph_pie. DATA lo_piechart TYPE REF TO zcl_excel_graph_pie.
* chartspace = ip_chart-&gt;get_elements_by_tag_name( name = &apos;chartSpace&apos; namespace = &apos;c&apos; ).
* coll_length = chartspace-&gt;get_length( ).
* iterator = chartspace-&gt;create_iterator( ).
*
* DO coll_length TIMES. &quot;always 1
* chartelem ?= iterator-&gt;get_next( ).
*
* node ?= chartelem-&gt;find_from_name( name = &apos;chart&apos; namespace = &apos;c&apos; ).
TYPES: BEGIN OF t_prop, TYPES: BEGIN OF t_prop,
val TYPE string, val TYPE string,
END OF t_prop. rtl TYPE string,
lang TYPE string,
END OF t_prop.
TYPES: BEGIN OF t_pagemargins,
b TYPE string,
l TYPE string,
r TYPE string,
t TYPE string,
header TYPE string,
footer TYPE string,
END OF t_pagemargins.
DATA ls_prop TYPE t_prop. DATA ls_prop TYPE t_prop.
DATA ls_pagemargins TYPE t_pagemargins.
node ?= ip_chart-&gt;if_ixml_node~get_first_child( ). node ?= ip_chart-&gt;if_ixml_node~get_first_child( ).
CHECK node IS NOT INITIAL. CHECK node IS NOT INITIAL.
node2 ?= node-&gt;find_from_name( name = &apos;plotArea&apos; namespace = &apos;c&apos; ).
CHECK node2 IS NOT INITIAL.
node3 ?= node2-&gt;find_from_name( name = &apos;pieChart&apos; namespace = &apos;c&apos; ).
IF node3 IS INITIAL.
node3 ?= node2-&gt;find_from_name( name = &apos;barChart&apos; namespace = &apos;c&apos; ).
IF node3 IS NOT INITIAL.
me-&gt;graph_type = c_graph_bars.
ENDIF.
ELSE.
me-&gt;graph_type = c_graph_pie.
ENDIF.
CHECK node3 IS NOT INITIAL.
node4 ?= node3-&gt;find_from_name( name = &apos;ser&apos; namespace = &apos;c&apos; ).
CHECK node4 IS NOT INITIAL.
node5 ?= node4-&gt;find_from_name( name = &apos;val&apos; namespace = &apos;c&apos; ).
CHECK node5 IS NOT INITIAL.
node6 ?= node5-&gt;find_from_name( name = &apos;numRef&apos; namespace = &apos;c&apos; ).
CHECK node6 IS NOT INITIAL.
node7 ?= node6-&gt;find_from_name( name = &apos;f&apos; namespace = &apos;c&apos; ).
CHECK node7 IS NOT INITIAL.
CASE me-&gt;graph_type. CASE me-&gt;graph_type.
WHEN c_graph_bars. WHEN c_graph_bars.
@ -416,30 +394,100 @@ endmethod.</source>
WHEN OTHERS. WHEN OTHERS.
ENDCASE. ENDCASE.
me-&gt;graph-&gt;ref = node7-&gt;get_value( ).
&quot;Fill properties &quot;Fill properties
node2 ?= node-&gt;find_from_name( name = &apos;date1904&apos; namespace = &apos;c&apos; ). node2 ?= node-&gt;find_from_name( name = &apos;date1904&apos; namespace = &apos;c&apos; ).
ZCL_EXCEL_READER_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ). zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
me-&gt;graph-&gt;ns_1904val = ls_prop-val. me-&gt;graph-&gt;ns_1904val = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;lang&apos; namespace = &apos;c&apos; ). node2 ?= node-&gt;find_from_name( name = &apos;lang&apos; namespace = &apos;c&apos; ).
ZCL_EXCEL_READER_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ). zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
me-&gt;graph-&gt;ns_langval = ls_prop-val. me-&gt;graph-&gt;ns_langval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;roundedCorners&apos; namespace = &apos;c&apos; ). node2 ?= node-&gt;find_from_name( name = &apos;roundedCorners&apos; namespace = &apos;c&apos; ).
ZCL_EXCEL_READER_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ). zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
me-&gt;graph-&gt;ns_roundedcornersval = ls_prop-val. me-&gt;graph-&gt;ns_roundedcornersval = ls_prop-val.
* node ?= chartElem-&gt;find_from_name( name = &apos;graphicFrame&apos; namespace = &apos;xdr&apos; ). &quot;---------------------------Read graph properties
* IF node IS NOT INITIAL. node2 ?= node-&gt;find_from_name( name = &apos;autoTitleDeleted&apos; namespace = &apos;c&apos; ).
* node2 ?= node-&gt;find_from_name( name = &apos;nvGraphicFramePr&apos; namespace = &apos;xdr&apos; ). zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
* CHECK node2 IS NOT INITIAL. me-&gt;graph-&gt;ns_autoTitleDeletedval = ls_prop-val.
* node3 ?= node2-&gt;find_from_name( name = &apos;cNvPr&apos; namespace = &apos;xdr&apos; ).
* CHECK node3 IS NOT INITIAL. &quot;plotArea
* me-&gt;fill_struct_from_attributes( EXPORTING ip_element = node3 CHANGING cp_structure = cnvpr ). CASE me-&gt;graph_type.
* lv_title = cnvpr-name. WHEN c_graph_bars.
* ENDIF. &quot;TODO
WHEN c_graph_pie.
node2 ?= node-&gt;find_from_name( name = &apos;varyColors&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_varyColorsval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;idx&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_idxval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;order&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_orderval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;f&apos; namespace = &apos;c&apos; ).
lo_piechart-&gt;REF = node3-&gt;get_value( ).
&quot;note: numCache avoided
node2 ?= node-&gt;find_from_name( name = &apos;showLegendKey&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_showLegendKeyval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;showVal&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_showValval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;showCatName&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_showCatNameval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;showSerName&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_showSerNameval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;showPercent&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_showPercentval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;showBubbleSize&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_showBubbleSizeval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;showLeaderLines&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_showLeaderLinesval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;firstSliceAng&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_firstSliceAngval = ls_prop-val.
WHEN OTHERS.
ENDCASE.
&quot;legend
CASE me-&gt;graph_type.
WHEN c_graph_bars.
&quot;TODO
WHEN c_graph_pie.
node2 ?= node-&gt;find_from_name( name = &apos;legendPos&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_legendPosval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;overlay&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_overlayval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;pPr&apos; namespace = &apos;a&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_pPrrtl = ls_prop-rtl.
node2 ?= node-&gt;find_from_name( name = &apos;endParaRPr&apos; namespace = &apos;a&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
lo_piechart-&gt;ns_endParaRPrlang = ls_prop-lang.
WHEN OTHERS.
ENDCASE.
node2 ?= node-&gt;find_from_name( name = &apos;plotVisOnly&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
me-&gt;graph-&gt;ns_plotVisOnlyval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;dispBlanksAs&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
me-&gt;graph-&gt;ns_dispBlanksAsval = ls_prop-val.
node2 ?= node-&gt;find_from_name( name = &apos;showDLblsOverMax&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_prop ).
me-&gt;graph-&gt;ns_showDLblsOverMaxval = ls_prop-val.
&quot;---------------------
node2 ?= node-&gt;find_from_name( name = &apos;pageMargins&apos; namespace = &apos;c&apos; ).
zcl_excel_reader_2007=&gt;fill_struct_from_attributes( EXPORTING ip_element = node2 CHANGING cp_structure = ls_pagemargins ).
me-&gt;graph-&gt;pagemargins = ls_pagemargins.
* ENDDO.
ENDMETHOD.</source> ENDMETHOD.</source>
</method> </method>

View File

@ -1,5 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<CLAS CLSNAME="ZCL_EXCEL_GRAPH" VERSION="1" LANGU="E" DESCRIPT="Graphic" UUID="02023211AE4F1EE28EDF2A8F8A97065E" CATEGORY="00" EXPOSURE="2" STATE="1" RELEASE="0" CLSCCINCL="X" FIXPT="X" UNICODE="X" CLSBCCAT="00" DURATION_TYPE="0 " RISK_LEVEL="0 "> <CLAS CLSNAME="ZCL_EXCEL_GRAPH" VERSION="1" LANGU="E" DESCRIPT="Graphic" UUID="02023211AE4F1EE28EDF2A8F8A97065E" CATEGORY="00" EXPOSURE="2" STATE="1" RELEASE="0" CLSCCINCL="X" FIXPT="X" UNICODE="X" CLSBCCAT="00" DURATION_TYPE="0 " RISK_LEVEL="0 ">
<types CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="T_PAGEMARGINS" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="1 " TYPTYPE="4" SRCROW1="10 " SRCCOLUMN1="4 " SRCROW2="17 " SRCCOLUMN2="23 " TYPESRC_LENG="229 " TYPESRC="BEGIN OF t_pagemargins,
b TYPE string,
l TYPE string,
r TYPE string,
t TYPE string,
header TYPE string,
footer TYPE string,
END OF t_pagemargins
"/>
<publicSection>class ZCL_EXCEL_GRAPH definition <publicSection>class ZCL_EXCEL_GRAPH definition
public public
create public . create public .
@ -8,10 +17,27 @@ public section.
*&quot;* public components of class ZCL_EXCEL_GRAPH *&quot;* public components of class ZCL_EXCEL_GRAPH
*&quot;* do not include other source files here!!! *&quot;* do not include other source files here!!!
types:
BEGIN OF t_pagemargins,
b TYPE string,
l TYPE string,
r TYPE string,
t TYPE string,
header TYPE string,
footer TYPE string,
END OF t_pagemargins .
data REF type STRING . data REF type STRING .
data NS_1904VAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT . data NS_1904VAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_LANGVAL type STRING value &apos;it-IT&apos;. &quot;#EC NOTEXT . data NS_LANGVAL type STRING value &apos;it-IT&apos;. &quot;#EC NOTEXT .
data NS_ROUNDEDCORNERSVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .</publicSection> data NS_ROUNDEDCORNERSVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data PAGEMARGINS type T_PAGEMARGINS .
data NS_AUTOTITLEDELETEDVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_PLOTVISONLYVAL type STRING value &apos;1&apos;. &quot;#EC NOTEXT .
data NS_DISPBLANKSASVAL type STRING value &apos;gap&apos;. &quot;#EC NOTEXT .
data NS_SHOWDLBLSOVERMAXVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
methods CONSTRUCTOR .</publicSection>
<protectedSection>protected section. <protectedSection>protected section.
*&quot;* protected components of class ZCL_EXCEL_GRAPH *&quot;* protected components of class ZCL_EXCEL_GRAPH
*&quot;* do not include other source files here!!!</protectedSection> *&quot;* do not include other source files here!!!</protectedSection>
@ -27,7 +53,23 @@ public section.
<localMacros>*&quot;* use this source file for any macro definitions you need <localMacros>*&quot;* use this source file for any macro definitions you need
*&quot;* in the implementation part of the class</localMacros> *&quot;* in the implementation part of the class</localMacros>
<attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_1904VAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="2 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/> <attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_1904VAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="2 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_AUTOTITLEDELETEDVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="6 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_DISPBLANKSASVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="8 " ATTDECLTYP="0" ATTVALUE="&apos;gap&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_LANGVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="3 " ATTDECLTYP="0" ATTVALUE="&apos;it-IT&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/> <attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_LANGVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="3 " ATTDECLTYP="0" ATTVALUE="&apos;it-IT&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_PLOTVISONLYVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="7 " ATTDECLTYP="0" ATTVALUE="&apos;1&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_ROUNDEDCORNERSVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="4 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/> <attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_ROUNDEDCORNERSVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="4 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="NS_SHOWDLBLSOVERMAXVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="9 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="PAGEMARGINS" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="5 " ATTDECLTYP="0" ATTEXPVIRT="0" TYPTYPE="1" TYPE="T_PAGEMARGINS" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="REF" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="1 " ATTDECLTYP="0" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/> <attribute CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="REF" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="1 " ATTDECLTYP="0" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<method CLSNAME="ZCL_EXCEL_GRAPH" CMPNAME="CONSTRUCTOR" VERSION="1" LANGU="E" DESCRIPT="CONSTRUCTOR" EXPOSURE="2" STATE="1" EDITORDER="1 " DISPID="0 " MTDTYPE="2" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<source>method CONSTRUCTOR.
&quot;Load default values
me-&gt;pagemargins-b = &apos;0.75&apos;.
me-&gt;pagemargins-l = &apos;0.7&apos;.
me-&gt;pagemargins-r = &apos;0.7&apos;.
me-&gt;pagemargins-t = &apos;0.75&apos;.
me-&gt;pagemargins-header = &apos;0.3&apos;.
me-&gt;pagemargins-footer = &apos;0.3&apos;.
endmethod.</source>
</method>
</CLAS> </CLAS>

View File

@ -8,7 +8,23 @@
public section. public section.
*&quot;* public components of class ZCL_EXCEL_GRAPH_PIE *&quot;* public components of class ZCL_EXCEL_GRAPH_PIE
*&quot;* do not include other source files here!!!</publicSection> *&quot;* do not include other source files here!!!
data NS_LEGENDPOSVAL type STRING value &apos;r&apos;. &quot;#EC NOTEXT .
data NS_OVERLAYVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_PPRRTL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_ENDPARARPRLANG type STRING value &apos;it-IT&apos;. &quot;#EC NOTEXT .
data NS_VARYCOLORSVAL type STRING value &apos;1&apos;. &quot;#EC NOTEXT .
data NS_FIRSTSLICEANGVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_IDXVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_ORDERVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_SHOWLEGENDKEYVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_SHOWVALVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_SHOWCATNAMEVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_SHOWSERNAMEVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_SHOWPERCENTVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_SHOWBUBBLESIZEVAL type STRING value &apos;0&apos;. &quot;#EC NOTEXT .
data NS_SHOWLEADERLINESVAL type STRING value &apos;1&apos;. &quot;#EC NOTEXT .</publicSection>
<protectedSection>protected section. <protectedSection>protected section.
*&quot;* protected components of class ZCL_EXCEL_GRAPH_PIE *&quot;* protected components of class ZCL_EXCEL_GRAPH_PIE
*&quot;* do not include other source files here!!!</protectedSection> *&quot;* do not include other source files here!!!</protectedSection>
@ -23,5 +39,20 @@ public section.
*&quot;* components in the private section</localTypes> *&quot;* components in the private section</localTypes>
<localMacros>*&quot;* use this source file for any macro definitions you need <localMacros>*&quot;* use this source file for any macro definitions you need
*&quot;* in the implementation part of the class</localMacros> *&quot;* in the implementation part of the class</localMacros>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_ENDPARARPRLANG" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="4 " ATTDECLTYP="0" ATTVALUE="&apos;it-IT&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_FIRSTSLICEANGVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="6 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_IDXVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="7 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_LEGENDPOSVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="1 " ATTDECLTYP="0" ATTVALUE="&apos;r&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_ORDERVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="8 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_OVERLAYVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="2 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_PPRRTL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="3 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_SHOWBUBBLESIZEVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="14 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_SHOWCATNAMEVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="11 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_SHOWLEADERLINESVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="15 " ATTDECLTYP="0" ATTVALUE="&apos;1&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_SHOWLEGENDKEYVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="9 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_SHOWPERCENTVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="13 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_SHOWSERNAMEVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="12 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_SHOWVALVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="10 " ATTDECLTYP="0" ATTVALUE="&apos;0&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZCL_EXCEL_GRAPH_PIE" CMPNAME="NS_VARYCOLORSVAL" VERSION="1" LANGU="E" EXPOSURE="2" STATE="1" EDITORDER="5 " ATTDECLTYP="0" ATTVALUE="&apos;1&apos;" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<inheritance CLSNAME="ZCL_EXCEL_GRAPH_PIE" REFCLSNAME="ZCL_EXCEL_GRAPH" VERSION="1" STATE="1"/> <inheritance CLSNAME="ZCL_EXCEL_GRAPH_PIE" REFCLSNAME="ZCL_EXCEL_GRAPH" VERSION="1" STATE="1"/>
</CLAS> </CLAS>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<CLAS CLSNAME="ZCL_EXCEL_WRITER_2007" VERSION="1" LANGU="E" DESCRIPT="Excel writer 2007" UUID="9551494D16947660E1000000C0A8FA28" CATEGORY="00" EXPOSURE="2" STATE="1" RELEASE="0" CLSCCINCL="X" FIXPT="X" UNICODE="X" CLSBCCAT="00" DURATION_TYPE="0 " RISK_LEVEL="0 "> <CLAS CLSNAME="ZCL_EXCEL_WRITER_2007" VERSION="1" LANGU="E" DESCRIPT="Excel writer 2007" UUID="9551494D16947660E1000000C0A8FA28" CATEGORY="00" EXPOSURE="2" STATE="1" RELEASE="0" CLSCCINCL="X" FIXPT="X" UNICODE="X" CLSBCCAT="00" DURATION_TYPE="0 " RISK_LEVEL="0 ">
<implementing CLSNAME="ZCL_EXCEL_WRITER_2007" REFCLSNAME="ZIF_EXCEL_WRITER" VERSION="1" EXPOSURE="2" STATE="1" RELTYPE="1"/> <implementing CLSNAME="ZCL_EXCEL_WRITER_2007" REFCLSNAME="ZIF_EXCEL_WRITER" VERSION="1" EXPOSURE="2" STATE="1" RELTYPE="1" EDITORDER="0 "/>
<publicSection>class ZCL_EXCEL_WRITER_2007 definition <publicSection>class ZCL_EXCEL_WRITER_2007 definition
public public
create public . create public .
@ -166,7 +166,7 @@ endmethod.</source>
</interfaceMethod> </interfaceMethod>
<method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE" VERSION="1" LANGU="E" DESCRIPT="Create Excel" EXPOSURE="1" STATE="1" EDITORDER="1 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0"> <method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE" VERSION="1" LANGU="E" DESCRIPT="Create Excel" EXPOSURE="1" STATE="1" EDITORDER="1 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE" SCONAME="EP_EXCEL" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="XSTRING"/> <parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE" SCONAME="EP_EXCEL" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="XSTRING"/>
<source>METHOD create. <source>method CREATE.
* Office 2007 file format is a cab of several xml files with extension .xlsx * Office 2007 file format is a cab of several xml files with extension .xlsx
@ -359,7 +359,7 @@ endmethod.</source>
* STEP 12: Create the final zip * STEP 12: Create the final zip
ep_excel = lo_zip-&gt;save( ). ep_excel = lo_zip-&gt;save( ).
ENDMETHOD.</source> endmethod.</source>
</method> </method>
<method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_CONTENT_TYPES" VERSION="1" LANGU="E" DESCRIPT="Create &apos;[Content_Types].xml&apos;" EXPOSURE="1" STATE="1" EDITORDER="2 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0"> <method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_CONTENT_TYPES" VERSION="1" LANGU="E" DESCRIPT="Create &apos;[Content_Types].xml&apos;" EXPOSURE="1" STATE="1" EDITORDER="2 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_CONTENT_TYPES" SCONAME="EP_CONTENT" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="XSTRING"/> <parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_CONTENT_TYPES" SCONAME="EP_CONTENT" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="XSTRING"/>
@ -1090,38 +1090,95 @@ endmethod.</source>
** Constant node name ** Constant node name
CONSTANTS: lc_xml_node_chartspace TYPE string VALUE &apos;c:chartSpace&apos;, CONSTANTS: lc_xml_node_chartspace TYPE string VALUE &apos;c:chartSpace&apos;,
lc_xml_node_ns_c TYPE string VALUE &apos;http://schemas.openxmlformats.org/drawingml/2006/chart&apos;, lc_xml_node_ns_c TYPE string VALUE &apos;http://schemas.openxmlformats.org/drawingml/2006/chart&apos;,
lc_xml_node_ns_a TYPE string VALUE &apos;http://schemas.openxmlformats.org/drawingml/2006/main&apos;, lc_xml_node_ns_a TYPE string VALUE &apos;http://schemas.openxmlformats.org/drawingml/2006/main&apos;,
lc_xml_node_ns_r TYPE string VALUE &apos;http://schemas.openxmlformats.org/officeDocument/2006/relationships&apos;, lc_xml_node_ns_r TYPE string VALUE &apos;http://schemas.openxmlformats.org/officeDocument/2006/relationships&apos;,
lc_xml_node_date1904 TYPE string VALUE &apos;c:date1904&apos;, lc_xml_node_date1904 TYPE string VALUE &apos;c:date1904&apos;,
lc_xml_node_lang TYPE string VALUE &apos;c:lang&apos;, lc_xml_node_lang TYPE string VALUE &apos;c:lang&apos;,
lc_xml_node_roundedcorners TYPE string VALUE &apos;c:roundedCorners&apos;, lc_xml_node_roundedcorners TYPE string VALUE &apos;c:roundedCorners&apos;,
lc_xml_node_altcont TYPE string VALUE &apos;mc:AlternateContent&apos;, lc_xml_node_altcont TYPE string VALUE &apos;mc:AlternateContent&apos;,
lc_xml_node_altcont_ns_mc TYPE string VALUE &apos;http://schemas.openxmlformats.org/markup-compatibility/2006&apos;, lc_xml_node_altcont_ns_mc TYPE string VALUE &apos;http://schemas.openxmlformats.org/markup-compatibility/2006&apos;,
lc_xml_node_choice TYPE string VALUE &apos;mc:Choice&apos;, lc_xml_node_choice TYPE string VALUE &apos;mc:Choice&apos;,
lc_xml_node_choice_ns_requires TYPE string VALUE &apos;c14&apos;, lc_xml_node_choice_ns_requires TYPE string VALUE &apos;c14&apos;,
lc_xml_node_choice_ns_c14 TYPE string VALUE &apos;http://schemas.microsoft.com/office/drawing/2007/8/2/chart&apos;, lc_xml_node_choice_ns_c14 TYPE string VALUE &apos;http://schemas.microsoft.com/office/drawing/2007/8/2/chart&apos;,
lc_xml_node_style TYPE string VALUE &apos;c14:style&apos;, lc_xml_node_style TYPE string VALUE &apos;c14:style&apos;,
lc_xml_node_style_ns_val TYPE string VALUE &apos;102&apos;, lc_xml_node_style_ns_val TYPE string VALUE &apos;102&apos;,
lc_xml_node_fallback TYPE string VALUE &apos;mc:Fallback&apos;, lc_xml_node_fallback TYPE string VALUE &apos;mc:Fallback&apos;,
lc_xml_node_style2 TYPE string VALUE &apos;c:style&apos;, lc_xml_node_style2 TYPE string VALUE &apos;c:style&apos;,
lc_xml_node_style2_ns_val TYPE string VALUE &apos;2&apos;. lc_xml_node_style2_ns_val TYPE string VALUE &apos;2&apos;,
&quot;---------------------------CHART
lc_xml_node_chart TYPE string VALUE &apos;c:chart&apos;,
lc_xml_node_autoTitleDeleted TYPE string VALUE &apos;c:autoTitleDeleted&apos;,
&quot;plotArea
lc_xml_node_plotArea TYPE string VALUE &apos;c:plotArea&apos;,
lc_xml_node_layout TYPE string VALUE &apos;c:layout&apos;,
&quot;plotArea-&gt;pie
lc_xml_node_pieChart TYPE string VALUE &apos;c:pieChart&apos;,
lc_xml_node_varyColors TYPE string VALUE &apos;c:varyColors&apos;,
lc_xml_node_ser TYPE string VALUE &apos;c:ser&apos;,
lc_xml_node_idx TYPE string VALUE &apos;c:idx&apos;,
lc_xml_node_order TYPE string VALUE &apos;c:order&apos;,
lc_xml_node_val TYPE string VALUE &apos;c:val&apos;,
lc_xml_node_numRef TYPE string VALUE &apos;c:numRef&apos;,
lc_xml_node_f TYPE string VALUE &apos;c:f&apos;, &quot;this is the range
&quot;note: numcache avoided
lc_xml_node_dLbls TYPE string VALUE &apos;c:dLbls&apos;,
lc_xml_node_showLegendKey TYPE string VALUE &apos;c:showLegendKey&apos;,
lc_xml_node_showVal TYPE string VALUE &apos;c:showVal&apos;,
lc_xml_node_showCatName TYPE string VALUE &apos;c:showCatName&apos;,
lc_xml_node_showSerName TYPE string VALUE &apos;c:showSerName&apos;,
lc_xml_node_showPercent TYPE string VALUE &apos;c:showPercent&apos;,
lc_xml_node_showBubbleSize TYPE string VALUE &apos;c:showBubbleSize&apos;,
lc_xml_node_showLeaderLines TYPE string VALUE &apos;c:showLeaderLines&apos;,
lc_xml_node_firstSliceAng TYPE string VALUE &apos;c:firstSliceAng&apos;,
&quot;plotArea-&gt;bar
lc_xml_node_barChart TYPE string VALUE &apos;c:barChart&apos;,
lc_xml_node_catAx TYPE string VALUE &apos;c:catAx&apos;,
lc_xml_node_valAx TYPE string VALUE &apos;c:valAx&apos;,
&quot;legend
lc_xml_node_legend TYPE string VALUE &apos;c:legend&apos;,
&quot;legend-&gt;pie
lc_xml_node_legendPos TYPE string VALUE &apos;c:legendPos&apos;,
* lc_xml_node_layout TYPE string VALUE &apos;c:layout&apos;, &quot;already exist
lc_xml_node_overlay TYPE string VALUE &apos;c:overlay&apos;,
lc_xml_node_txPr TYPE string VALUE &apos;c:txPr&apos;,
lc_xml_node_bodyPr TYPE string VALUE &apos;a:bodyPr&apos;,
lc_xml_node_lstStyle TYPE string VALUE &apos;a:lstStyle&apos;,
lc_xml_node_p TYPE string VALUE &apos;a:p&apos;,
lc_xml_node_pPr TYPE string VALUE &apos;a:pPr&apos;,
lc_xml_node_defRPr TYPE string VALUE &apos;a:defRPr&apos;,
lc_xml_node_endParaRPr TYPE string VALUE &apos;a:endParaRPr&apos;,
&quot;legend-&gt;bar
lc_xml_node_plotVisOnly TYPE string VALUE &apos;c:plotVisOnly&apos;,
lc_xml_node_dispBlanksAs TYPE string VALUE &apos;c:dispBlanksAs&apos;,
lc_xml_node_showDLblsOverMax TYPE string VALUE &apos;c:showDLblsOverMax&apos;,
&quot;---------------------------END OF CHART
lc_xml_node_printsettings TYPE string VALUE &apos;c:printSettings&apos;,
lc_xml_node_headerfooter TYPE string VALUE &apos;c:headerFooter&apos;,
lc_xml_node_pagemargins TYPE string VALUE &apos;c:pageMargins&apos;,
lc_xml_node_pagesetup TYPE string VALUE &apos;c:pageSetup&apos;.
DATA: lo_ixml TYPE REF TO if_ixml, DATA: lo_ixml TYPE REF TO if_ixml,
lo_document TYPE REF TO if_ixml_document, lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element, lo_element_root TYPE REF TO if_ixml_element,
lo_element_cellanchor TYPE REF TO if_ixml_element, lo_element_cellanchor TYPE REF TO if_ixml_element,
lo_encoding TYPE REF TO if_ixml_encoding, lo_encoding TYPE REF TO if_ixml_encoding,
lo_streamfactory TYPE REF TO if_ixml_stream_factory, lo_streamfactory TYPE REF TO if_ixml_stream_factory,
lo_ostream TYPE REF TO if_ixml_ostream, lo_ostream TYPE REF TO if_ixml_ostream,
lo_renderer TYPE REF TO if_ixml_renderer. lo_renderer TYPE REF TO if_ixml_renderer.
DATA: lv_rel_id TYPE i. DATA: lv_rel_id TYPE i.
DATA lo_element TYPE REF TO if_ixml_element. DATA lo_element TYPE REF TO if_ixml_element.
DATA lo_element2 TYPE REF TO if_ixml_element. DATA lo_element2 TYPE REF TO if_ixml_element.
DATA lo_element3 TYPE REF TO if_ixml_element. DATA lo_element3 TYPE REF TO if_ixml_element.
DATA lo_element4 TYPE REF TO if_ixml_element.
DATA lo_element5 TYPE REF TO if_ixml_element.
DATA lo_element6 TYPE REF TO if_ixml_element.
DATA lo_element7 TYPE REF TO if_ixml_element.
********************************************************************** **********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP * STEP 1: Create [Content_Types].xml into the root of the ZIP
@ -1149,6 +1206,21 @@ endmethod.</source>
********************************************************************** **********************************************************************
* STEP 4: Create chart * STEP 4: Create chart
DATA lo_chartb TYPE REF TO zcl_excel_graph_bars.
DATA lo_chartp TYPE REF TO zcl_excel_graph_pie.
&quot;Identify chart type
CASE io_drawing-&gt;graph_type.
WHEN zcl_excel_drawing=&gt;c_graph_bars.
lo_chartb ?= io_drawing-&gt;graph.
WHEN zcl_excel_drawing=&gt;c_graph_pie.
lo_chartp ?= io_drawing-&gt;graph.
WHEN OTHERS.
ENDCASE.
DATA lo_chart TYPE REF TO zcl_excel_graph. DATA lo_chart TYPE REF TO zcl_excel_graph.
lo_chart = io_drawing-&gt;graph. lo_chart = io_drawing-&gt;graph.
@ -1180,7 +1252,7 @@ endmethod.</source>
lo_element2-&gt;set_attribute_ns( name = &apos;xmlns:c14&apos; lo_element2-&gt;set_attribute_ns( name = &apos;xmlns:c14&apos;
value = lc_xml_node_choice_ns_c14 ). value = lc_xml_node_choice_ns_c14 ).
&quot;C14:style &quot;C14:style
lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_style lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_style
parent = lo_element2 ). parent = lo_element2 ).
lo_element3-&gt;set_attribute_ns( name = &apos;val&apos; lo_element3-&gt;set_attribute_ns( name = &apos;val&apos;
@ -1196,23 +1268,169 @@ endmethod.</source>
lo_element3-&gt;set_attribute_ns( name = &apos;val&apos; lo_element3-&gt;set_attribute_ns( name = &apos;val&apos;
value = lc_xml_node_style2_ns_val ). value = lc_xml_node_style2_ns_val ).
DATA lo_chartb TYPE REF TO zcl_excel_graph_bars. &quot;---------------------------CHART
DATA lo_chartp TYPE REF TO zcl_excel_graph_pie. lo_element = lo_document-&gt;create_simple_element( name = lc_xml_node_chart
parent = lo_element_root ).
lo_element2 = lo_document-&gt;create_simple_element( name = lc_xml_node_autoTitleDeleted
parent = lo_element ).
lo_element2-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chart-&gt;ns_autoTitleDeletedval ).
&quot;plotArea
lo_element2 = lo_document-&gt;create_simple_element( name = lc_xml_node_plotArea
parent = lo_element ).
lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_layout
parent = lo_element2 ).
CASE io_drawing-&gt;graph_type.
WHEN zcl_excel_drawing=&gt;c_graph_bars.
&quot;----bar
lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_barChart
parent = lo_element2 ).
lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_catAx
parent = lo_element2 ).
lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_valAx
parent = lo_element2 ).
&quot;TODO
WHEN zcl_excel_drawing=&gt;c_graph_pie.
&quot;----pie
lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_pieChart
parent = lo_element2 ).
lo_element4 = lo_document-&gt;create_simple_element( name = lc_xml_node_varyColors
parent = lo_element3 ).
lo_element4-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_varyColorsval ).
lo_element4 = lo_document-&gt;create_simple_element( name = lc_xml_node_ser
parent = lo_element3 ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_idx
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_idxval ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_order
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_orderval ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_val
parent = lo_element4 ).
lo_element6 = lo_document-&gt;create_simple_element( name = lc_xml_node_numRef
parent = lo_element5 ).
lo_element7 = lo_document-&gt;create_simple_element( name = lc_xml_node_f
parent = lo_element6 ).
lo_element7-&gt;set_value( value = lo_chartp-&gt;REF ).
lo_element4 = lo_document-&gt;create_simple_element( name = lc_xml_node_dLbls
parent = lo_element3 ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_showLegendKey
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_showLegendKeyval ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_showVal
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_showValval ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_showCatName
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_showCatNameval ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_showSerName
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_showSerNameval ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_showPercent
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_showPercentval ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_showBubbleSize
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_showBubbleSizeval ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_showLeaderLines
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_showLeaderLinesval ).
lo_element4 = lo_document-&gt;create_simple_element( name = lc_xml_node_firstSliceAng
parent = lo_element3 ).
lo_element4-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_firstSliceAngval ).
WHEN OTHERS.
ENDCASE.
CASE io_drawing-&gt;graph_type. &quot;legend
WHEN zcl_excel_drawing=&gt;c_graph_bars. lo_element2 = lo_document-&gt;create_simple_element( name = lc_xml_node_legend
lo_chartb ?= io_drawing-&gt;graph. parent = lo_element ).
WHEN zcl_excel_drawing=&gt;c_graph_pie. CASE io_drawing-&gt;graph_type.
lo_chartp ?= io_drawing-&gt;graph. WHEN zcl_excel_drawing=&gt;c_graph_bars.
&quot;----bar
&quot;TODO
WHEN zcl_excel_drawing=&gt;c_graph_pie.
WHEN OTHERS. &quot;----pie
ENDCASE. lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_legendPos
parent = lo_element2 ).
lo_element3-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_legendPosval ).
lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_layout
parent = lo_element2 ).
lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_overlay
parent = lo_element2 ).
lo_element3-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chartp-&gt;ns_overlayval ).
lo_element3 = lo_document-&gt;create_simple_element( name = lc_xml_node_txPr
parent = lo_element2 ).
lo_element4 = lo_document-&gt;create_simple_element( name = lc_xml_node_bodyPr
parent = lo_element3 ).
lo_element4 = lo_document-&gt;create_simple_element( name = lc_xml_node_lstStyle
parent = lo_element3 ).
lo_element4 = lo_document-&gt;create_simple_element( name = lc_xml_node_p
parent = lo_element3 ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_pPr
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;rtl&apos;
value = lo_chartp-&gt;ns_pPrrtl ).
lo_element6 = lo_document-&gt;create_simple_element( name = lc_xml_node_defRPr
parent = lo_element5 ).
lo_element5 = lo_document-&gt;create_simple_element( name = lc_xml_node_endParaRPr
parent = lo_element4 ).
lo_element5-&gt;set_attribute_ns( name = &apos;lang&apos;
value = lo_chartp-&gt;ns_endParaRPrlang ).
WHEN OTHERS.
ENDCASE.
lo_element2 = lo_document-&gt;create_simple_element( name = lc_xml_node_plotVisOnly
parent = lo_element ).
lo_element2-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chart-&gt;ns_plotVisOnlyval ).
lo_element2 = lo_document-&gt;create_simple_element( name = lc_xml_node_dispBlanksAs
parent = lo_element ).
lo_element2-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chart-&gt;ns_dispBlanksAsval ).
lo_element2 = lo_document-&gt;create_simple_element( name = lc_xml_node_showDLblsOverMax
parent = lo_element ).
lo_element2-&gt;set_attribute_ns( name = &apos;val&apos;
value = lo_chart-&gt;ns_showDLblsOverMaxval ).
&quot;---------------------------END OF CHART
&quot;printSettings
lo_element = lo_document-&gt;create_simple_element( name = lc_xml_node_printsettings
parent = lo_element_root ).
&quot;headerFooter
lo_element2 = lo_document-&gt;create_simple_element( name = lc_xml_node_headerfooter
parent = lo_element ).
&quot;pageMargins
lo_element2 = lo_document-&gt;create_simple_element( name = lc_xml_node_pagemargins
parent = lo_element ).
lo_element2-&gt;set_attribute_ns( name = &apos;b&apos;
value = lo_chart-&gt;pagemargins-b ).
lo_element2-&gt;set_attribute_ns( name = &apos;l&apos;
value = lo_chart-&gt;pagemargins-l ).
lo_element2-&gt;set_attribute_ns( name = &apos;r&apos;
value = lo_chart-&gt;pagemargins-r ).
lo_element2-&gt;set_attribute_ns( name = &apos;t&apos;
value = lo_chart-&gt;pagemargins-t ).
lo_element2-&gt;set_attribute_ns( name = &apos;header&apos;
value = lo_chart-&gt;pagemargins-header ).
lo_element2-&gt;set_attribute_ns( name = &apos;footer&apos;
value = lo_chart-&gt;pagemargins-footer ).
&quot;pageSetup
lo_element2 = lo_document-&gt;create_simple_element( name = lc_xml_node_pageSetup
parent = lo_element ).
********************************************************************** **********************************************************************
* STEP 5: Create xstring stream * STEP 5: Create xstring stream
@ -1986,7 +2204,7 @@ endmethod.</source>
<parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET" SCONAME="IV_ACTIVE" VERSION="1" LANGU="E" DESCRIPT="General Flag" CMPTYPE="1" MTDTYPE="0" EDITORDER="2 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="FLAG" PARVALUE="&apos;&apos;"/> <parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET" SCONAME="IV_ACTIVE" VERSION="1" LANGU="E" DESCRIPT="General Flag" CMPTYPE="1" MTDTYPE="0" EDITORDER="2 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="FLAG" PARVALUE="&apos;&apos;"/>
<parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET" SCONAME="EP_CONTENT" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="3 " DISPID="0 " PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="XSTRING"/> <parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET" SCONAME="EP_CONTENT" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="3 " DISPID="0 " PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="XSTRING"/>
<exception CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET" SCONAME="ZCX_EXCEL" VERSION="1" LANGU="E" DESCRIPT="Exceptions for ABAP2XLSX" MTDTYPE="0" EDITORDER="1 "/> <exception CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET" SCONAME="ZCX_EXCEL" VERSION="1" LANGU="E" DESCRIPT="Exceptions for ABAP2XLSX" MTDTYPE="0" EDITORDER="1 "/>
<source>METHOD create_xl_sheet. <source>method CREATE_XL_SHEET.
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
* issue #237 - Error writing column-style * issue #237 - Error writing column-style
* - Stefan Schmöcker, 2012-11-01 * - Stefan Schmöcker, 2012-11-01
@ -3594,7 +3812,7 @@ endmethod.</source>
lo_renderer = lo_ixml-&gt;create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer = lo_ixml-&gt;create_renderer( ostream = lo_ostream document = lo_document ).
lo_renderer-&gt;render( ). lo_renderer-&gt;render( ).
ENDMETHOD.</source> endmethod.</source>
</method> </method>
<method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET_RELS" VERSION="1" LANGU="E" DESCRIPT="Create &apos;xl/workbook/_rels/sheet.xml.rels&apos;" EXPOSURE="1" STATE="1" EDITORDER="13 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0"> <method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET_RELS" VERSION="1" LANGU="E" DESCRIPT="Create &apos;xl/workbook/_rels/sheet.xml.rels&apos;" EXPOSURE="1" STATE="1" EDITORDER="13 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET_RELS" SCONAME="IO_WORKSHEET" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="3" TYPE="ZCL_EXCEL_WORKSHEET"/> <parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_SHEET_RELS" SCONAME="IO_WORKSHEET" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="3" TYPE="ZCL_EXCEL_WORKSHEET"/>
@ -4999,7 +5217,7 @@ endmethod.</source>
</method> </method>
<method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_WORKBOOK" VERSION="1" LANGU="E" DESCRIPT="Create &apos;xl/workbook.xml&apos;" EXPOSURE="1" STATE="1" EDITORDER="18 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0"> <method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_WORKBOOK" VERSION="1" LANGU="E" DESCRIPT="Create &apos;xl/workbook.xml&apos;" EXPOSURE="1" STATE="1" EDITORDER="18 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_WORKBOOK" SCONAME="EP_CONTENT" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="XSTRING"/> <parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="CREATE_XL_WORKBOOK" SCONAME="EP_CONTENT" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="XSTRING"/>
<source>METHOD create_xl_workbook. <source>method CREATE_XL_WORKBOOK.
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
* issue #230 - Pimp my Code * issue #230 - Pimp my Code
* - Stefan Schmöcker, (done) 2012-11-07 * - Stefan Schmöcker, (done) 2012-11-07
@ -5316,7 +5534,7 @@ endmethod.</source>
lo_renderer = lo_ixml-&gt;create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer = lo_ixml-&gt;create_renderer( ostream = lo_ostream document = lo_document ).
lo_renderer-&gt;render( ). lo_renderer-&gt;render( ).
ENDMETHOD.</source> endmethod.</source>
</method> </method>
<method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="FLAG2BOOL" VERSION="1" LANGU="E" DESCRIPT="Convert a FLAG to BOOLEAN value" EXPOSURE="0" STATE="1" EDITORDER="19 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0"> <method CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="FLAG2BOOL" VERSION="1" LANGU="E" DESCRIPT="Convert a FLAG to BOOLEAN value" EXPOSURE="0" STATE="1" EDITORDER="19 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="FLAG2BOOL" SCONAME="IP_FLAG" VERSION="1" LANGU="E" DESCRIPT="General Flag" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="FLAG"/> <parameter CLSNAME="ZCL_EXCEL_WRITER_2007" CMPNAME="FLAG2BOOL" SCONAME="IP_FLAG" VERSION="1" LANGU="E" DESCRIPT="General Flag" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="FLAG"/>

View File

@ -23,11 +23,16 @@ DATA: lo_excel TYPE REF TO zcl_excel,
lo_worksheet TYPE REF TO zcl_excel_worksheet, lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_drawing TYPE REF TO zcl_excel_drawing. lo_drawing TYPE REF TO zcl_excel_drawing.
DATA lv_value TYPE i.
DATA: ls_io TYPE skwf_io. DATA: ls_io TYPE skwf_io.
DATA: ls_upper TYPE ZEXCEL_DRAWING_LOCATION, DATA: ls_upper TYPE zexcel_drawing_location,
ls_lower TYPE ZEXCEL_DRAWING_LOCATION. ls_lower TYPE zexcel_drawing_location.
DATA lo_bar TYPE REF TO zcl_excel_graph_bars.
DATA lo_pie TYPE REF TO zcl_excel_graph_pie.
DATA lv_media TYPE xstring.
CONSTANTS: gc_save_file_name TYPE string VALUE &apos;39_Charts.xlsx&apos;. CONSTANTS: gc_save_file_name TYPE string VALUE &apos;39_Charts.xlsx&apos;.
INCLUDE zdemo_excel_outputopt_incl. INCLUDE zdemo_excel_outputopt_incl.
@ -41,22 +46,28 @@ START-OF-SELECTION.
lo_worksheet = lo_excel-&gt;get_active_worksheet( ). lo_worksheet = lo_excel-&gt;get_active_worksheet( ).
lo_worksheet-&gt;set_title( &apos;Sheet1&apos; ). lo_worksheet-&gt;set_title( &apos;Sheet1&apos; ).
&quot; create global drawing, set position and media from web repository &quot; Set values for chart
lv_value = 1.
lo_worksheet-&gt;set_cell( ip_column = &apos;J&apos; ip_row = 1 ip_value = lv_value ).
lv_value = 2.
lo_worksheet-&gt;set_cell( ip_column = &apos;J&apos; ip_row = 2 ip_value = lv_value ).
lv_value = 3.
lo_worksheet-&gt;set_cell( ip_column = &apos;J&apos; ip_row = 3 ip_value = lv_value ).
&quot; Create a pie chart and assign value range
CREATE OBJECT lo_pie.
lo_pie-&gt;ref = &apos;Sheet1!$J$1:$J$3&apos;. &quot;VALUE RANGE FOR CHART
&quot; Create global drawing, set type as pie chart, assign chart, set position and media type
lo_drawing = lo_worksheet-&gt;excel-&gt;add_new_drawing( lo_drawing = lo_worksheet-&gt;excel-&gt;add_new_drawing(
ip_type = zcl_excel_drawing=&gt;type_chart ip_type = zcl_excel_drawing=&gt;type_chart
ip_title = &apos;titolografico&apos; ). ip_title = &apos;CHART TITLE&apos; ).
lo_drawing-&gt;graph = lo_pie.
data lo_bar type ref to ZCL_EXCEL_GRAPH_BARS. lo_drawing-&gt;graph_type = zcl_excel_drawing=&gt;c_graph_pie.
create object lo_bar.
lo_bar-&gt;REF = &apos;&apos;. &quot;VALUE RANGE FOR CHART
lo_drawing-&gt;graph = lo_bar.
&quot;Set chart position (anchor 2 cells)
ls_lower-row = 10. ls_lower-row = 10.
ls_lower-col = 10. ls_lower-col = 10.
lo_drawing-&gt;set_position2( lo_drawing-&gt;set_position2(
EXPORTING EXPORTING
ip_from = ls_upper ip_from = ls_upper
@ -64,10 +75,10 @@ START-OF-SELECTION.
lo_drawing-&gt;set_media( lo_drawing-&gt;set_media(
EXPORTING EXPORTING
ip_media = &apos;0&apos; &quot;usato per il template ip_media = lv_media &quot;used for template (binary content)
ip_media_type = &apos;xml&apos; ip_media_type = &apos;xml&apos;
ip_width = 0 &quot;usati solo per le immagini ip_width = 0 &quot;used only for image types, not for charts
ip_height = 0 ). &quot;usati solo per le immagini ip_height = 0 ). &quot;used only for image types, not for charts
lo_worksheet-&gt;add_drawing( lo_drawing ). lo_worksheet-&gt;add_drawing( lo_drawing ).