spout icon indicating copy to clipboard operation
spout copied to clipboard

Not just another custom column widths PR

Open aphofstede opened this issue 5 years ago • 40 comments

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

aphofstede avatar Dec 20 '19 22:12 aphofstede

Verified that @aphofstede has signed the CLA. Thanks for the pull request!

boxcla avatar Dec 20 '19 22:12 boxcla

@adrilo Did you notice this one? Thanks!

aphofstede avatar Jan 19 '20 18:01 aphofstede

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 03 '20 19:03 CLAassistant

Hi, how could I have this code on my composer vendor directory ? I do need also to resize columns thanks

stephane34123 avatar Mar 27 '20 11:03 stephane34123

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

mawi12345 avatar Mar 29 '20 13:03 mawi12345

Is this gonna be merged soon ? I was gonna work on the same issue.

ardabeyazoglu avatar Apr 15 '20 10:04 ardabeyazoglu

Any updates? When will this be merged?

cylosh avatar May 07 '20 00:05 cylosh

Thanks @mawi12345 - I merged your fixes. Any chance we can get this merged into master?

aphofstede avatar May 26 '20 11:05 aphofstede

@mawi12345 Could you sign the CLA as well?

aphofstede avatar May 26 '20 21:05 aphofstede

@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.

aphofstede avatar May 27 '20 06:05 aphofstede

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).

mawi12345 avatar Jun 13 '20 18:06 mawi12345

Any news for the merging ?

DimitriSoucanye avatar Jul 20 '20 13:07 DimitriSoucanye

Merged. Something seems to be wrong with TravisCI though.. @adrilo could you check maybe?

aphofstede avatar Oct 29 '20 22:10 aphofstede

Tests succeeded. https://travis-ci.org/github/box/spout/builds/740119579

aphofstede avatar Oct 31 '20 20:10 aphofstede

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 ?

lauri-elevant avatar Jan 20 '21 11:01 lauri-elevant

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?

aphofstede avatar Jan 20 '21 12:01 aphofstede

Why this PR is still not merged?

jadamec avatar Feb 10 '21 21:02 jadamec

@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

Saracevas avatar Feb 25 '21 12:02 Saracevas

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).

1stthomas avatar Feb 26 '21 17:02 1stthomas

@adrilo Fixed conflicts.

aphofstede avatar Apr 05 '21 17:04 aphofstede

@adrilo Any chance this might get merged anytime soon? Would love to have it mainline.

rmartell avatar May 05 '21 21:05 rmartell

Please merge

dnovikov32 avatar May 07 '21 09:05 dnovikov32

@adrilo Merged master into this one again. Please review?

aphofstede avatar May 26 '21 21:05 aphofstede

Pull request started end of 2019, now it's middle of 2021. Any news on this, why such a feature is not merged?

matths avatar Jun 30 '21 13:06 matths

Is the source still developing?

ChestnutSir avatar Jul 05 '21 04:07 ChestnutSir

Please merge

kshuiroy avatar Jul 14 '21 10:07 kshuiroy

Please, merge!

Rdtynby avatar Jul 26 '21 14:07 Rdtynby

Merge this please.

IgorVodka avatar Jul 26 '21 21:07 IgorVodka

Cool! Let's merge this PR!

nartzis avatar Aug 05 '21 14:08 nartzis

Is the project dead?

Rdtynby avatar Nov 22 '21 12:11 Rdtynby