mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 11:06:15 +08:00
#179 - as suggested by Gregor I added the colored tabs to demoreport 4
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@346 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
This commit is contained in:
parent
6e902d884b
commit
6a92c01fa7
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-2"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PROG NAME="ZDEMO_EXCEL4" VARCL="X" SUBC="1" CNAM="FEMIA" CDAT="20100711" UNAM="K2_SCHMOECK" UDAT="20120324" VERN="000050" RSTAT="T" RMAND="001" RLOAD="E" FIXPT="X" SDATE="20120324" STIME="111822" IDATE="20120324" ITIME="111822" UCCHECK="X">
|
<PROG NAME="ZDEMO_EXCEL4" VARCL="X" SUBC="1" RSTAT="T" RMAND="001" RLOAD="E" FIXPT="X" UCCHECK="X">
|
||||||
<textPool>
|
<textPool>
|
||||||
<language SPRAS="E">
|
<language SPRAS="E">
|
||||||
<textElement ID="R" ENTRY="abap2xlsx Demo: Create XLXS with multiple sheets" LENGTH="49 "/>
|
<textElement ID="R" ENTRY="abap2xlsx Demo: Create XLXS with multiple sheets" LENGTH="49 "/>
|
||||||
|
@ -18,9 +18,12 @@ REPORT zdemo_excel4.
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
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_hyperlink TYPE REF TO zcl_excel_hyperlink.
|
|
||||||
|
|
||||||
DATA: ls_header TYPE zexcel_s_worksheet_head_foot,
|
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
|
||||||
|
|
||||||
|
lv_tabcolor TYPE zexcel_s_tabcolor,
|
||||||
|
|
||||||
|
ls_header TYPE zexcel_s_worksheet_head_foot,
|
||||||
ls_footer TYPE zexcel_s_worksheet_head_foot.
|
ls_footer TYPE zexcel_s_worksheet_head_foot.
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '04_Sheets.xlsx'.
|
CONSTANTS: gc_save_file_name TYPE string VALUE '04_Sheets.xlsx'.
|
||||||
|
@ -37,10 +40,15 @@ START-OF-SELECTION.
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet1' ).
|
lo_worksheet->set_title( ip_title = 'Sheet1' ).
|
||||||
lo_worksheet->zif_excel_sheet_properties~selected = zif_excel_sheet_properties=>c_selected.
|
lo_worksheet->zif_excel_sheet_properties~selected = zif_excel_sheet_properties=>c_selected.
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the first sheet' ).
|
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the first sheet' ).
|
||||||
|
* Set color to tab with sheetname - Red
|
||||||
|
lv_tabcolor-rgb = zcl_excel_style_color=>create_new_argb( ip_red = 'FF'
|
||||||
|
ip_green = '00'
|
||||||
|
ip_blu = '00' ).
|
||||||
|
lo_worksheet->set_tabcolor( lv_tabcolor ).
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet2!B2' ).
|
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet2!B2' ).
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to second sheet' ip_hyperlink = lo_hyperlink ).
|
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to second sheet' ip_hyperlink = lo_hyperlink ).
|
||||||
|
|
||||||
|
|
||||||
" Page printing settings
|
" Page printing settings
|
||||||
lo_worksheet->sheet_setup->set_page_margins( ip_header = '1' ip_footer = '1' ip_unit = 'cm' ).
|
lo_worksheet->sheet_setup->set_page_margins( ip_header = '1' ip_footer = '1' ip_unit = 'cm' ).
|
||||||
lo_worksheet->sheet_setup->black_and_white = 'X'.
|
lo_worksheet->sheet_setup->black_and_white = 'X'.
|
||||||
|
@ -68,6 +76,11 @@ START-OF-SELECTION.
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
lo_worksheet = lo_excel->add_new_worksheet( ).
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet2' ).
|
lo_worksheet->set_title( ip_title = 'Sheet2' ).
|
||||||
|
* Set color to tab with sheetname - Green
|
||||||
|
lv_tabcolor-rgb = zcl_excel_style_color=>create_new_argb( ip_red = '00'
|
||||||
|
ip_green = 'FF'
|
||||||
|
ip_blu = '00' ).
|
||||||
|
lo_worksheet->set_tabcolor( lv_tabcolor ).
|
||||||
lo_worksheet->zif_excel_sheet_properties~selected = zif_excel_sheet_properties=>c_selected.
|
lo_worksheet->zif_excel_sheet_properties~selected = zif_excel_sheet_properties=>c_selected.
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the second sheet' ).
|
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the second sheet' ).
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet1!B2' ).
|
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet1!B2' ).
|
||||||
|
@ -79,6 +92,11 @@ START-OF-SELECTION.
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
lo_worksheet = lo_excel->add_new_worksheet( ).
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet3' ).
|
lo_worksheet->set_title( ip_title = 'Sheet3' ).
|
||||||
|
* Set color to tab with sheetname - Blue
|
||||||
|
lv_tabcolor-rgb = zcl_excel_style_color=>create_new_argb( ip_red = '00'
|
||||||
|
ip_green = '00'
|
||||||
|
ip_blu = 'FF' ).
|
||||||
|
lo_worksheet->set_tabcolor( lv_tabcolor ).
|
||||||
lo_worksheet->zif_excel_sheet_properties~hidden = zif_excel_sheet_properties=>c_hidden.
|
lo_worksheet->zif_excel_sheet_properties~hidden = zif_excel_sheet_properties=>c_hidden.
|
||||||
|
|
||||||
lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header
|
lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header
|
||||||
|
@ -86,6 +104,11 @@ START-OF-SELECTION.
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
lo_worksheet = lo_excel->add_new_worksheet( ).
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet4' ).
|
lo_worksheet->set_title( ip_title = 'Sheet4' ).
|
||||||
|
* Set color to tab with sheetname - other color
|
||||||
|
lv_tabcolor-rgb = zcl_excel_style_color=>create_new_argb( ip_red = '00'
|
||||||
|
ip_green = 'FF'
|
||||||
|
ip_blu = 'FF' ).
|
||||||
|
lo_worksheet->set_tabcolor( lv_tabcolor ).
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Cell B3 has value 0' ).
|
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Cell B3 has value 0' ).
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 0 ).
|
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 0 ).
|
||||||
lo_worksheet->zif_excel_sheet_properties~show_zeros = zif_excel_sheet_properties=>c_hidezero.
|
lo_worksheet->zif_excel_sheet_properties~show_zeros = zif_excel_sheet_properties=>c_hidezero.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user