spout
spout copied to clipboard
Not just another custom column widths PR
Adds support for setting default row height, default column width and custom column widths configuration. Fixes #118, among others. I checked what other PRs had been created to fix this and the objections in the conversations there. Hopefully this fits your standards.
Things to note:
- Supports xlsx and ods
- Has tests
- PSR-2
- Default row height and column widths can be set on the writer or using the options manager
- To be more flexible on when the column widths are set, sheet initialisation was moved to when the first row is written
Known issues:
- Widths/heights not configurable per worksheet, only for the whole workbook
- ODS default column width only applies to the columns after the right-most custom column width
- No dynamic option, should be a separate PR imho
- No docs yet, let's see if you like the approach first
Verified that @aphofstede has signed the CLA. Thanks for the pull request!
@adrilo Did you notice this one? Thanks!
Hi, how could I have this code on my composer vendor directory ? I do need also to resize columns thanks
Found you delayed the \fwrite($sheetFilePointer, '<sheetData>');
in WorksheetManager
. But therefore invalid sheets will be generated if you simply call $writer->addNewSheetAndMakeItCurrent()
without adding data to the worksheet.
Fixed this issue by moving the bool that the records if the <sheetData>
has been from WorksheetManager
to the Worksheet
instance.
I have refactored setDefaultColumnWidth
and setDefaultRowHeight
to use the OptionsManager
like writer->setTempFolder
. I believe setting default values before the writer is opened is the easier way.
See: https://github.com/aphofstede/spout/pull/1
Is this gonna be merged soon ? I was gonna work on the same issue.
Any updates? When will this be merged?
Thanks @mawi12345 - I merged your fixes. Any chance we can get this merged into master?
@mawi12345 Could you sign the CLA as well?
@mawi12345 Sloppy of me to not check first, but it looks like your PR broke some tests, could your PR a fix for those? Thanks.
CLA has been signed by me. @aphofstede if have fixed the test in https://github.com/aphofstede/spout/pull/2. I still need to test if the columns are correct in LibreOffice (not only in the tests).
Any news for the merging ?
Merged. Something seems to be wrong with TravisCI though.. @adrilo could you check maybe?
Tests succeeded. https://travis-ci.org/github/box/spout/builds/740119579
This PR makes it a viable replacement for phpexcel for our use case, creating the same files using only a fraction of the resources. Fantastic work @aphofstede !
Is there a more active fork of the project that has this merged ?
Thanks. Yeah same for us. We are just using my branch for now. I have tried reaching the maintainers but haven't heard back from them.
Is there a more active fork of the project that has this merged ?
Not sure! What other interesting/active forks are out there?
Why this PR is still not merged?
@jadamec: Why this PR is still not merged?
The main contributor of this project (@adrilo) has parted ways with Box and so lost admin access to the repo and could no longer release new versions for quite a while. He seems to be back though so fingers crossed.
See: https://github.com/box/spout/issues/754#issuecomment-771615781
Please merge with the changes in the master due to the
This branch is out-of-date with the base branch
warning (if @adrilo would accept such a PR).
@adrilo Fixed conflicts.
@adrilo Any chance this might get merged anytime soon? Would love to have it mainline.
Please merge
@adrilo Merged master into this one again. Please review?
Pull request started end of 2019, now it's middle of 2021. Any news on this, why such a feature is not merged?
Is the source still developing?
Please merge
Please, merge!
Merge this please.
Cool! Let's merge this PR!
Is the project dead?