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

Files appearing blank - workbook.xml is being assigned a r:id that does not exist(?) #556

Closed
jacobnbrum opened this issue Oct 16, 2017 · 3 comments
Assignees

Comments

@jacobnbrum
Copy link

We have been using the axlsx gem for some time now and its really a great gem.
Recently we upgraded to version 2.1.0 pre and then we started running into some issues. Occasionally (seemingly at random) the files would appear to be blank when opened in an xlsx viewer (excel, calc & sheet).

After comparing what should have been the exact same file (except one actually displayed the information) and comparing the xml files, I noticed that in /xl/workbook.xml one file (the working one) had a line <sheet name="MyDoc" sheetId="1" r:id="rId4"></sheet> while the other said <sheet name="MyDoc" sheetId="1" r:id="rId12"></sheet>. When I changed the rId to rId4 the file began to work properly.

Looking in the workbook.xml.rels file (/xl/_rels/workbook.xml.rels) I only see relationships with the ID of rId4 and rId5.
<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Target="worksheets/sheet1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId4"/><Relationship Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Id="rId5"/></Relationships>

Is there anything I can do to ensure that the r:id is only set to existing relationships?

Thank you!

@randym randym self-assigned this Feb 20, 2018
@randym
Copy link
Owner

randym commented Feb 20, 2018

Hi @jacobnbrum couple of questions:

Are you multithreading sheet generation?
Are you serializing the same package more than once?

@ayushlodhi11
Copy link

I am also facing the same issue!! Any update?

@noniq
Copy link
Collaborator

noniq commented Dec 19, 2019

Generating workbooks in axlsx is not threadsafe (see #477).

Note that this has been fixed in caxlsx 3.0.1: caxlsx/caxlsx#10

@noniq noniq closed this as completed Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants