Skip to content

There is a bug concerning T_STYLEMAPPING2 in ZCL_EXCEL #1345

@darnoc312

Description

@darnoc312

Please insert the following three code lines below in ZCL_EXCEL's method add_new_style for testing purpose:

 METHOD add_new_style. CREATE OBJECT eo_style EXPORTING ip_guid = ip_guid io_clone_of = io_clone_of. styles->add( eo_style ). DATA: style2 TYPE zexcel_s_stylemapping. * Copy to new representations style2 = stylemapping_dynamic_style( eo_style ). INSERT style2 INTO TABLE t_stylemapping1. INSERT style2 INTO TABLE t_stylemapping2.  IF sy-subrc NE 0. "Test BREAK-POINT. "Test ENDIF "Test ENDMETHOD.

Then start program ZDEMO_EXCEL34 and you will get to this break point.
This happens if the method add_new_style is called from method add_static_styles (means add static styles to dynamic styles) during the writing process.

Because the static style record is not deleted it is not possible to insert the new record with the corresponding dynamic style data.
This is the reason why we currently cannot store the style object in the dynamic stylemapping record immediately like it was intended in the beginning of ABAP2XLSX (earlier field name 'cl_style').
The problem is known since commit d446407. There it is the sub part named "Removed also issue with style class". But this solution is a workaround and not a bug fix.
It implements a new ZCL_EXCEL's method get_style_from_guid and removes the field 'cl_style' from stylemapping structure.
This method now needs a lot of performance looping at the styles collection to get the style object.
Direct access via a dynamic stylemapping record would make this method faster if the bug is fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions