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

Not just another custom column widths PR #715

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

aphofstede
Copy link

@aphofstede aphofstede commented Dec 20, 2019

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

@boxcla
Copy link

boxcla commented Dec 20, 2019

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

@aphofstede
Copy link
Author

@adrilo Did you notice this one? Thanks!

@CLAassistant
Copy link

CLAassistant commented Mar 3, 2020

CLA assistant check
All committers have signed the CLA.

@aphofstede aphofstede changed the title Yet another custom column widths PR Not just another custom column widths PR Mar 3, 2020
@stephane34123
Copy link

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

@mawi12345
Copy link

mawi12345 commented Mar 29, 2020

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: aphofstede#1

@ardabeyazoglu
Copy link

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

@cylosh
Copy link

cylosh commented May 7, 2020

Any updates? When will this be merged?

Use options manager for default row height and column width
@aphofstede
Copy link
Author

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

@aphofstede
Copy link
Author

@mawi12345 Could you sign the CLA as well?

@aphofstede
Copy link
Author

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

@Saracevas
Copy link

Saracevas commented Feb 25, 2021

@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: #754 (comment)

@1stthomas
Copy link

1stthomas commented Feb 26, 2021

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

# Conflicts:
#	src/Spout/Writer/ODS/Manager/WorksheetManager.php
#	src/Spout/Writer/XLSX/Manager/WorksheetManager.php
@aphofstede
Copy link
Author

@adrilo Fixed conflicts.

@rmartell
Copy link

rmartell commented May 5, 2021

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

@dnovikov32
Copy link

Please merge

@aphofstede
Copy link
Author

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

@matths
Copy link

matths commented Jun 30, 2021

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

@ChestnutSir
Copy link

Is the source still developing?

@kshuiroy
Copy link

Please merge

@Rdtynby
Copy link

Rdtynby commented Jul 26, 2021

Please, merge!

@IgorVodka
Copy link

Merge this please.

@nartzis
Copy link

nartzis commented Aug 5, 2021

Cool! Let's merge this PR!

@Rdtynby
Copy link

Rdtynby commented Nov 22, 2021

Is the project dead?

@aphofstede
Copy link
Author

@adrilo has been active recently, but haven't heard any comments on this.

@adrilo
Copy link
Collaborator

adrilo commented Nov 30, 2021

The project is not totally dead, but I have very little time to work on it these days... So I would not expect big changes in the near future.

@nartzis
Copy link

nartzis commented Jan 20, 2022

@aphofstede While PR is still open, would you like to add clearColumnWidths function like here rentsoft#2

@Stunext
Copy link

Stunext commented Feb 7, 2022

2019 pull request still open 3 years later? Totally dead

@jmslbam
Copy link

jmslbam commented Feb 8, 2022

Can we help in some way? Do we all need to open a GoFundMe, can I chip in some budget for development time?

Because what I know see is that the main branch has been updated with PHPCS / PHP Stan etc, to the merge probaly won't go through. @aphofstede fixed the merged conflicts, but then again it diverded to far from main that it couldn't get merged.

If we can come up with a time-frame, person X fixes merge conflicts, and then someone with merge rights to finish the merge. That would also be ok, just let me know. I can find some time in March / April to look at the merge conflicts?

If it's lack of time because it's not paid work, then we can look for some option to provided the budget. Looking at this enough people would like to see this one go through.

I just put action to my words and am Sponsering this project https://github.com/sponsors/adrilo, throughout my freelance company. If you all who are using this in a paid project just chip in 1 hour worth of development time.

This PR can land, but only if we all support Open Source by chipping time or sponsering, we can't expect this to be fixed for free. Come on everyone, we can make this work.

@aphofstede
Copy link
Author

I'd gladly fix any merge conflicts again for this to go in, but am hesitant to spend the time before a confirmation from a maintainer that this will then be merged. (Which probably means them reviewing the code, at least superficially)

@Slamdunk
Copy link

Slamdunk commented Mar 1, 2022

@aphofstede this package license is permissive: https://choosealicense.com/licenses/apache-2.0/

Box is a company, I vote for a community driven fork: I give my availability to maintain it across active PHP versions.

If you step in with me, we can start it today; @adrilo will be invited as a maintainer too

@Slamdunk
Copy link

Slamdunk commented Mar 2, 2022

Merged in openspout/openspout#4

@adrilo
Copy link
Collaborator

adrilo commented Mar 3, 2022

@aphofstede this package license is permissive: choosealicense.com/licenses/apache-2.0

Box is a company, I vote for a community driven fork: I give my availability to maintain it across active PHP versions.

If you step in with me, we can start it today; @adrilo will be invited as a maintainer too

This may be the best move to see all these PRs get through. I am aiming for a high level of quality (code structure, tests, documentation, internationalization...) and have extra requirements such as having similar features added for both XLSX and ODS. The drawback is that each new feature requires a lot of things and needs attention. Given my lack of time, it makes it very hard to review and merge such features.

Good luck with this fork, I'm happy if it helps!

@Slamdunk
Copy link

Slamdunk commented Mar 3, 2022

@adrilo you have been invited in @openspout as a maintainer.

I am already used to package maintenance and quality code base (see i.e. paratest) so I can easily take care of all that; many stalled PR of box/spout have already been merged there.

But your experience on the topic is invaluable, like for example #617 (comment), so I'd really appreciate if you can accept the invitation: you can drop your review on the core issues and ideas, and I'll manage the rest 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Column Widths