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

Writer\Html output is much too large #1235

Closed
werbfred opened this issue Nov 8, 2019 · 9 comments
Closed

Writer\Html output is much too large #1235

werbfred opened this issue Nov 8, 2019 · 9 comments

Comments

@werbfred
Copy link

werbfred commented Nov 8, 2019

This is:

- [ ] a bug report
- [x ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

When using the save method from PhpOffice\PhpSpreadsheet\Writer\Html, we could expect that only the usefull data is being outputed. This works fine for PhpOffice\PhpSpreadsheet\Writer\Csv.

What is the current behavior?

Currently PhpOffice\PhpSpreadsheet\Writer\Html uses the method Worksheet::calculateWorksheetDimension() which is relying on Worksheet::getHighestColumn().

In this case it could be better to rely on Worksheet::getHighestDataColumn(). This would avoid displaying a lot of empty cells on the right side of the html table. HTML file would also be much smaller.

What are the steps to reproduce?

Call PhpOffice\PhpSpreadsheet\Writer\Html::save() and have the generated file rendered in your favortie web browser.

Which versions of PhpSpreadsheet and PHP are affected?

Php version 7.3
PhpSpreadsheet version 1.9

@werbfred
Copy link
Author

werbfred commented Nov 8, 2019

Looking at the source code I would suggest that in Html::generateSheetData() the line

$dimension = explode(':', $sheet->calculateWorksheetDimension());

should be replaced by

$dimension = explode(':', $sheet->calculateWorksheetDataDimension());

That would do the job I believe.

@stale
Copy link

stale bot commented Jan 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Jan 7, 2020
@werbfred
Copy link
Author

werbfred commented Jan 7, 2020

Any feedback if this feature make sense ?

@stale stale bot removed the stale label Jan 7, 2020
@adjenks
Copy link

adjenks commented Feb 7, 2020

Only the stale bot is responding to my tickets as well.

@stale
Copy link

stale bot commented Apr 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Apr 7, 2020
@werbfred
Copy link
Author

werbfred commented Apr 8, 2020

Up

@stale stale bot removed the stale label Apr 8, 2020
@PowerKiKi
Copy link
Member

I guess it makes sense. Have any of you had a look a git blame to see if there is a reason why we don't already do that?

@werbfred
Copy link
Author

Should I make a Pull Request ?

@werbfred
Copy link
Author

Pull Request raised : Writer\Html output is much too large #1537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants