mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 14:06:24 +08:00
Fix < 7.02 compatibility problem in ZDEMO_EXCEL24.
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@139 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
This commit is contained in:
parent
58b31cfed3
commit
7b2a4c1a50
|
@ -1,10 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-16"?>
|
||||
<PROG NAME="ZDEMO_EXCEL24" VARCL="X" SUBC="1" CNAM="BCUSER" CDAT="20110129" UNAM="FEMIA" UDAT="20110201" VERN="000024" RSTAT="T" RMAND="001" RLOAD="E" FIXPT="X" SDATE="20110201" STIME="230834" IDATE="20110201" ITIME="230704" UCCHECK="X">
|
||||
<PROG NAME="ZDEMO_EXCEL24" VARCL="X" SUBC="1" CNAM="BCUSER" CDAT="20110129" UNAM="BCUSER" UDAT="20110217" VERN="000027" RSTAT="T" RMAND="001" RLOAD="E" FIXPT="X" SDATE="20110217" STIME="202205" IDATE="20110217" ITIME="202205" UCCHECK="X">
|
||||
<textPool>
|
||||
<language SPRAS="E">
|
||||
<textElement ID="R" ENTRY="abap2xlsx Demo: Multiple sheets with different default date formats" LENGTH="70 "/>
|
||||
</language>
|
||||
</textPool>
|
||||
<programDocumentation/>
|
||||
<source>*&---------------------------------------------------------------------*
|
||||
*& Report ZDEMO_EXCEL23
|
||||
*&
|
||||
|
@ -21,7 +22,9 @@ DATA: lo_excel TYPE REF TO zcl_excel,
|
|||
lo_excel_writer TYPE REF TO zif_excel_writer,
|
||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
||||
column_dimension TYPE REF TO zcl_excel_worksheet_columndime,
|
||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink.
|
||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
|
||||
style_yymmddslash TYPE REF TO zcl_excel_style,
|
||||
style_yymmddslash_guid TYPE zexcel_cell_style.
|
||||
|
||||
DATA: lv_file TYPE xstring,
|
||||
lv_bytecount TYPE i,
|
||||
|
@ -82,14 +85,20 @@ START-OF-SELECTION.
|
|||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 3 ip_value = 'Current Date:' ).
|
||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 4 ip_value = sy-datum ).
|
||||
|
||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 6 ip_value = 'Date Format set to YYYYMMDDSLASH:' ).
|
||||
style_yymmddslash = lo_excel->add_new_style( ).
|
||||
style_yymmddslash->number_format->format_code = zcl_excel_style_number_format=>c_format_date_yymmddslash.
|
||||
style_yymmddslash_guid = style_yymmddslash->get_guid( ).
|
||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 7 ip_value = sy-datum ip_style = style_yymmddslash_guid ).
|
||||
|
||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet3!B2' ).
|
||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 6 ip_value = 'This is link to the third sheet' ip_hyperlink = lo_hyperlink ).
|
||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 9 ip_value = 'This is link to the third sheet' ip_hyperlink = lo_hyperlink ).
|
||||
|
||||
" Third sheet
|
||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
||||
" TODO: It seems that the zcl_excel_style_number_format=>c_format_date_yyyymmddslash
|
||||
" does not produce a valid output
|
||||
lo_worksheet->set_default_excel_date_format( zcl_excel_style_number_format=>c_format_date_yyyymmddslash ).
|
||||
lo_worksheet->set_default_excel_date_format( zcl_excel_style_number_format=>c_format_date_yyyymmddslash ).
|
||||
lo_worksheet->set_title( ip_title = 'Sheet3' ).
|
||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 1 ip_value = 'Date Format set to YYYY/MM/DD' ).
|
||||
" Insert current date
|
||||
|
|
Loading…
Reference in New Issue
Block a user