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

Error opening xlsx file generated by jsreport. #42

Open
thiagogualberto opened this issue Oct 23, 2020 · 2 comments
Open

Error opening xlsx file generated by jsreport. #42

thiagogualberto opened this issue Oct 23, 2020 · 2 comments

Comments

@thiagogualberto
Copy link

Guys, good morning !!
I'm using jsreport. I have an xlsx template with a header and I use jsreport to insert rows in the spreadsheet. This process inserts content below the header of my template. In addition, I modify 2 header cells with information from my customer's data.
I generate the file with this information and save it on my computer. However, opening the file shows the following error: "We encountered a problem with content in 'plan-de-acao_rti.xlsx. Do you want us to try to recover as much as possible? If you trust the source of this workbook, click Yes. "

Could anyone tell me what could be causing this?

@pofider
Copy link
Contributor

pofider commented Oct 23, 2020

You are producing an underlying xml that excel doesn't like because you are breaking some of its rules. It's hard to say which one.

I see two approaches:

  1. Store the excel file as 'corrupted.xlsx'. Then copy it to the 'fixed.xlsx'. Open the 'fixed.xlsx' in the excel app and let it fix. Save it. Rename both to zip files, decompress and compare the content.

  2. Start from scratch by creating tiny few cells excel in the desktop app. Then rename it to zip and explore its content. Then try to replicate the same using xlsx recipe helpers. Iterate and add complexity until you reach the desired result.

@thiagogualberto
Copy link
Author

Thank You! @pofider

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

2 participants