mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 16:36:12 +08:00
Demo 39
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@391 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
This commit is contained in:
parent
359be03cf5
commit
8779be0adf
|
@ -33,7 +33,6 @@ DATA: ls_upper TYPE zexcel_drawing_location,
|
||||||
DATA lo_bar TYPE REF TO zcl_excel_graph_bars.
|
DATA lo_bar TYPE REF TO zcl_excel_graph_bars.
|
||||||
DATA lo_bar2 TYPE REF TO zcl_excel_graph_bars.
|
DATA lo_bar2 TYPE REF TO zcl_excel_graph_bars.
|
||||||
DATA lo_pie TYPE REF TO zcl_excel_graph_pie.
|
DATA lo_pie TYPE REF TO zcl_excel_graph_pie.
|
||||||
DATA lv_media TYPE xstring.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '39_Charts.xlsx'.
|
CONSTANTS: gc_save_file_name TYPE string VALUE '39_Charts.xlsx'.
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
INCLUDE zdemo_excel_outputopt_incl.
|
||||||
|
@ -82,44 +81,39 @@ START-OF-SELECTION.
|
||||||
|
|
||||||
CALL METHOD lo_pie->create_serie
|
CALL METHOD lo_pie->create_serie
|
||||||
EXPORTING
|
EXPORTING
|
||||||
ip_idx = 0
|
|
||||||
ip_order = 0
|
ip_order = 0
|
||||||
ip_lbl = 'Sheet1!$B$1:$B$3'
|
ip_sheet = 'Sheet1'
|
||||||
ip_REF = 'Sheet1!$A$1:$A$3'
|
ip_lbl_from_col = 'B'
|
||||||
ip_sername = 'My serie 1'
|
ip_lbl_from_row = '1'
|
||||||
.
|
ip_lbl_to_col = 'B'
|
||||||
|
ip_lbl_to_row = '3'
|
||||||
|
ip_ref_from_col = 'A'
|
||||||
|
ip_ref_from_row = '1'
|
||||||
|
ip_ref_to_col = 'A'
|
||||||
|
ip_ref_to_row = '3'
|
||||||
|
ip_sername = 'My serie 1'.
|
||||||
|
|
||||||
CALL METHOD lo_pie->create_serie
|
" Set style
|
||||||
EXPORTING
|
lo_pie->set_style( zcl_excel_graph=>c_style_15 ).
|
||||||
ip_idx = 1
|
|
||||||
ip_order = 1
|
|
||||||
ip_lbl = 'Sheet1!$D$1:$D$3'
|
|
||||||
ip_REF = 'Sheet1!$C$1:$C$3'
|
|
||||||
ip_sername = 'My serie 2'
|
|
||||||
.
|
|
||||||
|
|
||||||
" Create a bar chart, series and axes
|
" Create a bar chart, series and axes
|
||||||
CREATE OBJECT lo_bar.
|
CREATE OBJECT lo_bar.
|
||||||
|
|
||||||
CALL METHOD lo_bar->create_serie
|
CALL METHOD lo_bar->create_serie
|
||||||
EXPORTING
|
EXPORTING
|
||||||
ip_idx = 0
|
|
||||||
ip_order = 0
|
ip_order = 0
|
||||||
ip_invertIfNegative = '0'
|
ip_invertifnegative = zcl_excel_graph_bars=>c_invertifnegative_no
|
||||||
ip_lbl = 'Sheet1!$D$1:$D$3'
|
ip_lbl = 'Sheet1!$D$1:$D$3'
|
||||||
ip_REF = 'Sheet1!$C$1:$C$3'
|
ip_ref = 'Sheet1!$C$1:$C$3'
|
||||||
ip_sername = 'My serie 1'
|
ip_sername = 'My serie 1'.
|
||||||
.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar->create_serie
|
CALL METHOD lo_bar->create_serie
|
||||||
EXPORTING
|
EXPORTING
|
||||||
ip_idx = 1
|
|
||||||
ip_order = 1
|
ip_order = 1
|
||||||
ip_invertIfNegative = '0'
|
ip_invertifnegative = zcl_excel_graph_bars=>c_invertifnegative_no
|
||||||
ip_lbl = 'Sheet1!$B$1:$B$3'
|
ip_lbl = 'Sheet1!$B$1:$B$3'
|
||||||
ip_REF = 'Sheet1!$A$1:$A$3'
|
ip_ref = 'Sheet1!$A$1:$A$3'
|
||||||
ip_sername = 'My serie 2'
|
ip_sername = 'My serie 2'.
|
||||||
.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar->create_ax
|
CALL METHOD lo_bar->create_ax
|
||||||
EXPORTING
|
EXPORTING
|
||||||
|
@ -163,18 +157,19 @@ START-OF-SELECTION.
|
||||||
* ip_crossbetween =
|
* ip_crossbetween =
|
||||||
.
|
.
|
||||||
|
|
||||||
|
" Set style
|
||||||
|
lo_bar->set_style( zcl_excel_graph=>c_style_16 ).
|
||||||
|
|
||||||
" Create a bar chart, series and axes
|
" Create a bar chart, series and axes
|
||||||
CREATE OBJECT lo_bar2.
|
CREATE OBJECT lo_bar2.
|
||||||
|
|
||||||
CALL METHOD lo_bar2->create_serie
|
CALL METHOD lo_bar2->create_serie
|
||||||
EXPORTING
|
EXPORTING
|
||||||
ip_idx = 0
|
|
||||||
ip_order = 0
|
ip_order = 0
|
||||||
ip_invertIfNegative = '0'
|
ip_invertifnegative = zcl_excel_graph_bars=>c_invertifnegative_no
|
||||||
ip_lbl = 'Sheet1!$D$1:$D$3'
|
ip_lbl = 'Sheet1!$D$1:$D$3'
|
||||||
ip_REF = 'Sheet1!$C$1:$C$3'
|
ip_ref = 'Sheet1!$C$1:$C$3'
|
||||||
ip_sername = 'My serie 1'
|
ip_sername = 'My serie 1'.
|
||||||
.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar2->create_ax
|
CALL METHOD lo_bar2->create_ax
|
||||||
EXPORTING
|
EXPORTING
|
||||||
|
@ -236,10 +231,7 @@ START-OF-SELECTION.
|
||||||
|
|
||||||
lo_drawing->set_media(
|
lo_drawing->set_media(
|
||||||
EXPORTING
|
EXPORTING
|
||||||
ip_media = lv_media "used for template (binary content)
|
ip_media_type = zcl_excel_drawing=>c_media_type_xml ).
|
||||||
ip_media_type = 'xml'
|
|
||||||
ip_width = 0 "used only for image types, not for charts
|
|
||||||
ip_height = 0 ). "used only for image types, not for charts
|
|
||||||
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
lo_worksheet->add_drawing( lo_drawing ).
|
||||||
|
@ -263,11 +255,7 @@ START-OF-SELECTION.
|
||||||
|
|
||||||
lo_drawing->set_media(
|
lo_drawing->set_media(
|
||||||
EXPORTING
|
EXPORTING
|
||||||
ip_media = lv_media "used for template (binary content)
|
ip_media_type = zcl_excel_drawing=>c_media_type_xml ).
|
||||||
ip_media_type = 'xml'
|
|
||||||
ip_width = 0 "used only for image types, not for charts
|
|
||||||
ip_height = 0 ). "used only for image types, not for charts
|
|
||||||
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
lo_worksheet->add_drawing( lo_drawing ).
|
||||||
|
|
||||||
|
@ -290,11 +278,7 @@ START-OF-SELECTION.
|
||||||
|
|
||||||
lo_drawing->set_media(
|
lo_drawing->set_media(
|
||||||
EXPORTING
|
EXPORTING
|
||||||
ip_media = lv_media "used for template (binary content)
|
ip_media_type = zcl_excel_drawing=>c_media_type_xml ).
|
||||||
ip_media_type = 'xml'
|
|
||||||
ip_width = 0 "used only for image types, not for charts
|
|
||||||
ip_height = 0 ). "used only for image types, not for charts
|
|
||||||
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
lo_worksheet->add_drawing( lo_drawing ).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user