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

Using partials corrupts the xlsx file. #186

Open
henrikbjorn opened this issue Dec 11, 2024 · 3 comments
Open

Using partials corrupts the xlsx file. #186

henrikbjorn opened this issue Dec 11, 2024 · 3 comments

Comments

@henrikbjorn
Copy link

Having a controller template doing

render 'statistics/shared/workbook`

and the _workbook partial being something like:

book = xlsx_package.add_worksheet
sheet = book.add_worksheet(name: "something")

sheet.add_row ['row', 'boat', 'show']

Makes the generated xlsx file corrupt. Moving the partial contents to the template directly and the file is not corrupt and work as it should.

@straydogstudio
Copy link
Collaborator

@henrikbjorn Are you directly rendering a partial without a regular template?

@henrikbjorn
Copy link
Author

Nope, i have a regular template which is rendering a partail. To share the xlsx generation I have a index template, a show template etc.

@straydogstudio
Copy link
Collaborator

Partials are used regularly in our tests without issue. Can you share gem versions for rails, caxlsx, caxlsx_rails? Can you duplicate it in a bare bones rails application?

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