You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DATA: gc_save_file_name TYPE string VALUE 'bug_rendering_value__x0041_.xlsx'.
INCLUDE zdemo_excel_outputopt_incl.
START-OF-SELECTION.
DATA(lo_excel) = NEW zcl_excel( ).
DATA(lo_worksheet) = lo_excel->get_active_worksheet( ).
lo_worksheet->set_cell(
ip_column = 1
ip_row = 1
ip_value = |_x0041_| ).
lcl_output=>output( cl_excel = lo_excel ).
Actual result:
Expected result:
Technical note:
When _x...._ where each dot is an hexadecimal digit 0-9 a-f A-F, is stored in sharedStrings.xml file, it's a special text interpreted by Excel as being the corresponding Unicode character U+.....
The text _x0041_ should be stored as _x005f_x0041_ in the sharedStrings.xml file so that to be rendered _x0041_, _x005f_ being the character _ (first underscore).
The text was updated successfully, but these errors were encountered:
sandraros
pushed a commit
to sandraros/abap2xlsx
that referenced
this issue
Jun 20, 2021
These lines are added to method SET_CELL of ZCL_EXCEL_WORKSHEET:
IF lv_value CS '_x'.
" Issue abap2xlsx#761 value "_x0041_" rendered as "A".
" "_x...._", where "." is 0-9 a-f or A-F (case insensitive), is an internal value in sharedStrings.xml
" that Excel uses to store special characters, it's interpreted like Unicode character U+....
" for instance "_x0041_" is U+0041 which is "A".
" To not interpret such text, the first underscore is replaced with "_x005f_".
" The value "_x0041_" is to be stored internally "_x005f_x0041_" so that it's rendered like "_x0041_".
" Note that REGEX is time consuming, it's why "CS" is used above to improve the performance.
REPLACE ALL OCCURRENCES OF REGEX '_(x[0-9a-fA-F]{4}_)' IN lv_value WITH '_x005f_$1' RESPECTING CASE.
ENDIF.
Code to reproduce:
Actual result:
Expected result:
Technical note:
When
_x...._
where each dot is an hexadecimal digit 0-9 a-f A-F, is stored in sharedStrings.xml file, it's a special text interpreted by Excel as being the corresponding Unicode characterU+....
.The text
_x0041_
should be stored as_x005f_x0041_
in the sharedStrings.xml file so that to be rendered_x0041_
,_x005f_
being the character_
(first underscore).The text was updated successfully, but these errors were encountered: