Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writer_xlsm and Writer_2007 not fully aligned again #1220

Open
darnoc312 opened this issue May 2, 2024 · 5 comments
Open

Writer_xlsm and Writer_2007 not fully aligned again #1220

darnoc312 opened this issue May 2, 2024 · 5 comments

Comments

@darnoc312
Copy link
Contributor

darnoc312 commented May 2, 2024

Thanks for approval of #1201.

But I think there could be a problem:

Look at class zcl_excel_writer_xlsm. Method create is a redefinition. Now the changed parameters of method create_xl_sheet_rels does not match to the call in this old redefinition.
Why there still is this redefinition ? The code seems to be anyway not up to date.
In my opinion the only purpose of the redefinition is the call

* STEP 9: Add vbaProject.bin to zip
    lo_zip->add( name    = me->c_xl_vbaproject
                 content = me->excel->zif_excel_book_vba_project~vbaproject ).

But this could be also achieved by the standard code in zcl_excel_writer_2007's create method by calling the method add_further_data_to_zip, which is redefined in zcl_excel_writer_xlsm with exactly this code.

@sandraros
Copy link
Collaborator

Could you add the exact reproduction steps, without mention to abap2xlsx inner code?

@darnoc312 darnoc312 changed the title Possible problem with pull request #1201 Possible problems with zcl_excel_writer_xlsm after pull request #1201 May 2, 2024
@darnoc312
Copy link
Contributor Author

For better understanding:

This is a similar problem as described in #588 which wouldn't have been a problem even back then if #349 (nearly 10 years old) was still fully implemented. The intention of this issue was to revert the redefinition of ZCL_EXCEL_WRITER_XLSM's create method,
to avoid problems like this or #588.
I think in the meantime a revert of the revert took place, which i can't understand in terms of time.
But the at that time (#349) implemented method add_further_data_to_zip is still there and could be reused like described above, if the redefinition is reverted again.

@sandraros
Copy link
Collaborator

But what is the issue now? If you can't reproduce (actual <> expected), I consider there should be no fix.

@darnoc312 darnoc312 changed the title Possible problems with zcl_excel_writer_xlsm after pull request #1201 Writer_xlsm and Writer_2007 not fully aligned again May 6, 2024
@darnoc312
Copy link
Contributor Author

For example:

  1. Try to write any excel file with VBA content and no drawings. Then the writer's method create_xl_sheet_rels now creates an unused relation in sheet#.xml.rels and of course no corresponding file (because of no data).

  2. The changes of ZCL_EXCEL_WRITER_XLSM->CREATE - obligatory parameter "IV_COMMENT_INDEX" had no value assigned to it #588/Issue #588: Unable to activate zcl_excel_writer_xlsm #598 are weird. It only satisfies the syntax check. No xl/comments#.xml file is created anyway. This part is missing in the code.
    if comments are used before Header/footer images and comments together create wrong file destinations in sheet#.xml.rels #1201 it nevertheless creates an relation in sheet#.xml.rels.
    After Header/footer images and comments together create wrong file destinations in sheet#.xml.rels #1201 it causes no fail, but this is coincidence and not intended. But of course you get no comments file in this case, too.

  3. The problem of ZCL_EXCEL_WRITER_XLSM - Does not handle charts built dynamically #392 still exists today, as you discovered yourself 3 years ago.

@sandraros
Copy link
Collaborator

Thanks, so, your two first points are about improving the quality of the XLSX and of the ABAP code, only the third point is a bug according to you.

I tag this issue "Enhancement".

Please open an issue concerning the third point and propose the minimal ABAP code to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants