Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Zero-cell rows fail in XLSX #16

Closed
chrisgraham opened this issue Apr 4, 2015 · 3 comments
Closed

Zero-cell rows fail in XLSX #16

chrisgraham opened this issue Apr 4, 2015 · 3 comments

Comments

@chrisgraham
Copy link

A row must have at least one cell, to avoid a repair error in Excel.

API users may add empty rows as spacers.

See my simple change here:
https://github.com/ocproducts/spout/commit/d2029a084fe45e9902e948fe5f1b6ef0cceec6a8

@adrilo
Copy link
Collaborator

adrilo commented Apr 4, 2015

@chrisgraham, I pushed a fix for that in #13 : aebdd1a

I took a slightly different approach though: I moved the logic to the parent class so that it is applied to all file types. And I figured that passing an empty row ([] not ['']) is not valid and should not result in a blank row being added. Instead, if you do $writer->addRow([]), it does nothing.

I like this approach better because I think [] and [''] represents 2 different things and should therefore be treated differently. What do you think?

@chrisgraham
Copy link
Author

I think that's reasonable. Either way the user has choice and no corrupt output.

@adrilo
Copy link
Collaborator

adrilo commented Apr 5, 2015

Cool! Closing this issue then.

@adrilo adrilo closed this as completed Apr 5, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants