mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 05:46:35 +08:00

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@194 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
162 lines
7.7 KiB
XML
162 lines
7.7 KiB
XML
<?xml version="1.0" encoding="utf-16"?>
|
|
<CLAS CLSNAME="ZCL_EXCEL_READER_XLSM" VERSION="1" LANGU="E" DESCRIPT="Excel with macro reader" UUID="0202322174CD1EE0A390E386CB9ED10B" CATEGORY="00" EXPOSURE="2" STATE="1" RELEASE="0" AUTHOR="FEMIA" CREATEDON="20110601" CHANGEDON="20110602" CHGDANYON="00000000" CLSFINAL="X" CLSCCINCL="X" FIXPT="X" UNICODE="X" R3RELEASE="702" CLSBCCAT="00" DURATION_TYPE="0 " RISK_LEVEL="0 " REFCLSNAME="ZCL_EXCEL_READER_2007" CHANGEDBY="FEMIA">
|
|
<publicSection>class ZCL_EXCEL_READER_XLSM definition
|
|
public
|
|
inheriting from ZCL_EXCEL_READER_2007
|
|
final
|
|
create public .
|
|
|
|
public section.
|
|
*"* public components of class ZCL_EXCEL_READER_XLSM
|
|
*"* do not include other source files here!!!</publicSection>
|
|
<protectedSection>protected section.
|
|
*"* protected components of class ZCL_EXCEL_READER_XLSM
|
|
*"* do not include other source files here!!!
|
|
|
|
methods LOAD_WORKBOOK
|
|
redefinition .
|
|
methods LOAD_WORKSHEET
|
|
redefinition .</protectedSection>
|
|
<privateSection>private section.
|
|
*"* private components of class ZCL_EXCEL_READER_XLSM
|
|
*"* do not include other source files here!!!
|
|
|
|
methods LOAD_VBAPROJECT
|
|
importing
|
|
!IP_PATH type STRING
|
|
!IP_EXCEL type ref to ZCL_EXCEL .</privateSection>
|
|
<localImplementation>*"* use this source file for the definition and implementation of
|
|
*"* local helper classes, interface definitions and type
|
|
*"* declarations</localImplementation>
|
|
<localTypes>*"* use this source file for any type of declarations (class
|
|
*"* definitions, interfaces or type declarations) you need for
|
|
*"* components in the private section</localTypes>
|
|
<localMacros>*"* use this source file for any macro definitions you need
|
|
*"* in the implementation part of the class</localMacros>
|
|
<inheritance CLSNAME="ZCL_EXCEL_READER_XLSM" REFCLSNAME="ZCL_EXCEL_READER_2007" VERSION="1" STATE="1" AUTHOR="FEMIA" CREATEDON="20110601" CHANGEDBY="FEMIA" CHANGEDON="20110602">
|
|
<redefinition CLSNAME="ZCL_EXCEL_READER_XLSM" REFCLSNAME="ZCL_EXCEL_READER_2007" VERSION="1" MTDNAME="LOAD_WORKBOOK" EXPOSURE="1"/>
|
|
<redefinition CLSNAME="ZCL_EXCEL_READER_XLSM" REFCLSNAME="ZCL_EXCEL_READER_2007" VERSION="1" MTDNAME="LOAD_WORKSHEET" EXPOSURE="1"/>
|
|
</inheritance>
|
|
<method CLSNAME="ZCL_EXCEL_READER_XLSM" CMPNAME="LOAD_VBAPROJECT" VERSION="1" LANGU="E" DESCRIPT="Load VBA binary" EXPOSURE="0" STATE="1" EDITORDER="1 " DISPID="0 " AUTHOR="FEMIA" CREATEDON="20110601" CHANGEDBY="FEMIA" CHANGEDON="20110602" MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
|
|
<parameter CLSNAME="ZCL_EXCEL_READER_XLSM" CMPNAME="LOAD_VBAPROJECT" SCONAME="IP_PATH" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " AUTHOR="FEMIA" CREATEDON="20110601" CHANGEDBY="FEMIA" CHANGEDON="20110602" PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="STRING"/>
|
|
<parameter CLSNAME="ZCL_EXCEL_READER_XLSM" CMPNAME="LOAD_VBAPROJECT" SCONAME="IP_EXCEL" VERSION="1" LANGU="E" DESCRIPT="Excel creator" CMPTYPE="1" MTDTYPE="0" EDITORDER="2 " DISPID="0 " AUTHOR="FEMIA" CREATEDON="20110601" CHANGEDBY="FEMIA" CHANGEDON="20110602" PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="3" TYPE="ZCL_EXCEL"/>
|
|
<source>METHOD load_vbaproject.
|
|
|
|
DATA lv_content TYPE xstring.
|
|
|
|
lv_content = me->get_from_zip_archive( ip_path ).
|
|
|
|
ip_excel->zif_excel_book_vba_project~set_vbaproject( lv_content ).
|
|
|
|
ENDMETHOD.</source>
|
|
</method>
|
|
<method CLSNAME="ZCL_EXCEL_READER_2007" CMPNAME="LOAD_WORKBOOK" VERSION="0" EXPOSURE="0" STATE="0" EDITORDER="0 " DISPID="0 " CREATEDON="00000000" CHANGEDON="00000000" MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
|
|
<source>METHOD load_workbook.
|
|
super->load_workbook( EXPORTING ip_path = ip_path
|
|
ip_excel = ip_excel ).
|
|
|
|
CONSTANTS: lc_vba_project TYPE string VALUE 'http://schemas.microsoft.com/office/2006/relationships/vbaProject'.
|
|
|
|
DATA: rels_workbook_path TYPE string,
|
|
rels_workbook TYPE REF TO if_ixml_document,
|
|
path TYPE string,
|
|
node TYPE REF TO if_ixml_element,
|
|
workbook TYPE REF TO if_ixml_document,
|
|
stripped_name TYPE chkfile,
|
|
dirname TYPE string,
|
|
relationship TYPE t_relationship,
|
|
fileversion TYPE t_fileversion,
|
|
workbookPr TYPE t_workbookPr.
|
|
|
|
FIELD-SYMBOLS: <worksheet> TYPE t_relationship.
|
|
|
|
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
|
|
EXPORTING
|
|
full_name = ip_path
|
|
IMPORTING
|
|
stripped_name = stripped_name
|
|
file_path = dirname.
|
|
|
|
" Read Workbook Relationships
|
|
CONCATENATE dirname '_rels/' stripped_name '.rels'
|
|
INTO rels_workbook_path.
|
|
|
|
rels_workbook = me->get_ixml_from_zip_archive( rels_workbook_path ).
|
|
|
|
node ?= rels_workbook->find_from_name( 'Relationship' ).
|
|
WHILE node IS BOUND.
|
|
me->fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = relationship ).
|
|
|
|
CASE relationship-type.
|
|
WHEN lc_vba_project.
|
|
" Read VBA binary
|
|
CONCATENATE dirname relationship-target INTO path.
|
|
me->load_vbaproject( ip_path = path
|
|
ip_excel = ip_excel ).
|
|
WHEN OTHERS.
|
|
ENDCASE.
|
|
|
|
node ?= node->get_next( ).
|
|
ENDWHILE.
|
|
|
|
" Read Workbook codeName
|
|
workbook = me->get_ixml_from_zip_archive( ip_path ).
|
|
node ?= workbook->find_from_name( 'fileVersion' ).
|
|
IF node IS BOUND.
|
|
|
|
fill_struct_from_attributes( EXPORTING ip_element = node
|
|
CHANGING cp_structure = fileversion ).
|
|
|
|
ip_excel->zif_excel_book_vba_project~set_codename( fileversion-codename ).
|
|
ENDIF.
|
|
|
|
" Read Workbook codeName
|
|
workbook = me->get_ixml_from_zip_archive( ip_path ).
|
|
node ?= workbook->find_from_name( 'workbookPr' ).
|
|
IF node IS BOUND.
|
|
|
|
fill_struct_from_attributes( EXPORTING ip_element = node
|
|
CHANGING cp_structure = workbookPr ).
|
|
|
|
ip_excel->zif_excel_book_vba_project~set_codename_pr( workbookPr-codename ).
|
|
ENDIF.
|
|
|
|
ENDMETHOD.</source>
|
|
</method>
|
|
<method CLSNAME="ZCL_EXCEL_READER_2007" CMPNAME="LOAD_WORKSHEET" VERSION="0" EXPOSURE="0" STATE="0" EDITORDER="0 " DISPID="0 " CREATEDON="00000000" CHANGEDON="00000000" MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
|
|
<source>METHOD load_worksheet.
|
|
|
|
super->load_worksheet( EXPORTING ip_path = ip_path
|
|
io_worksheet = io_worksheet ).
|
|
|
|
DATA: path TYPE string,
|
|
node TYPE REF TO if_ixml_element,
|
|
worksheet TYPE REF TO if_ixml_document,
|
|
sheetPr TYPE t_sheetPr.
|
|
|
|
|
|
* " Read Workbook codeName
|
|
* workbook = me->get_ixml_from_zip_archive( ip_path ).
|
|
* node ?= workbook->find_from_name( 'fileVersion' ).
|
|
* IF node IS BOUND.
|
|
*
|
|
* fill_struct_from_attributes( EXPORTING ip_element = node
|
|
* CHANGING cp_structure = fileversion ).
|
|
*
|
|
* IO_WORKSHEET->zif_excel_book_vba_project~set_codename( fileversion-codename ).
|
|
* ENDIF.
|
|
|
|
" Read Workbook codeName
|
|
worksheet = me->get_ixml_from_zip_archive( ip_path ).
|
|
node ?= worksheet->find_from_name( 'sheetPr' ).
|
|
IF node IS BOUND.
|
|
|
|
fill_struct_from_attributes( EXPORTING ip_element = node
|
|
CHANGING cp_structure = sheetpr ).
|
|
|
|
io_worksheet->zif_excel_sheet_vba_project~set_codename_pr( sheetpr-codename ).
|
|
ENDIF.
|
|
ENDMETHOD.</source>
|
|
</method>
|
|
</CLAS>
|