mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 11:06:15 +08:00
Bugfix range conversion (#628)
When reading xlsx and autofilters are being applied a dump occured when autofilter range was defined like "Sheet1!#REF1" Such ranges are now ignored so that the xlsx can be read.
This commit is contained in:
parent
1da0be9fb9
commit
84aa650b8e
|
@ -553,7 +553,12 @@ method CONVERT_RANGE2COLUMN_A_ROW.
|
|||
|
||||
ELSEIF i_range CS '!'. " c) sheetname existing - does not start with '
|
||||
SPLIT i_range AT '!' INTO lv_sheet lv_range.
|
||||
|
||||
" begin Dennis Schaaf
|
||||
IF lv_range CP '*#REF*'.
|
||||
lv_errormessage = 'Invalid range'(001).
|
||||
zcx_excel=>raise_text( lv_errormessage ).
|
||||
ENDIF.
|
||||
" end Dennis Schaaf
|
||||
ELSE. " d) no sheetname - just area
|
||||
lv_range = i_range.
|
||||
ENDIF.
|
||||
|
|
|
@ -2005,7 +2005,8 @@ method LOAD_WORKBOOK.
|
|||
* insert autofilters
|
||||
*--------------------------------------------------------------------*
|
||||
WHEN zcl_excel_autofilters=>c_autofilter.
|
||||
lo_autofilter = io_excel->add_new_autofilter( io_sheet = <worksheet>-worksheet ) .
|
||||
" begin Dennis Schaaf
|
||||
TRY.
|
||||
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = lv_range_value
|
||||
IMPORTING e_column_start = lv_col_start_alpha
|
||||
e_column_end = lv_col_end_alpha
|
||||
|
@ -2013,7 +2014,12 @@ method LOAD_WORKBOOK.
|
|||
e_row_end = ls_area-row_end ).
|
||||
ls_area-col_start = zcl_excel_common=>convert_column2int( lv_col_start_alpha ).
|
||||
ls_area-col_end = zcl_excel_common=>convert_column2int( lv_col_end_alpha ).
|
||||
lo_autofilter = io_excel->add_new_autofilter( io_sheet = <worksheet>-worksheet ) .
|
||||
lo_autofilter->set_filter_area( is_area = ls_area ).
|
||||
CATCH zcx_excel.
|
||||
" we expected a range but it was not usable, so just ignore it
|
||||
ENDTRY.
|
||||
" end Dennis Schaaf
|
||||
|
||||
*--------------------------------------------------------------------*
|
||||
* repeat print rows/columns
|
||||
|
|
Loading…
Reference in New Issue
Block a user