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 #1537

Closed
wants to merge 1 commit into from
Closed

Writer\Html output is much too large #1537

wants to merge 1 commit into from

Conversation

werbfred
Copy link

@werbfred werbfred commented Jun 18, 2020

…stDataColumn() which seems to be more adequate than Worksheet::calculateWorksheetDimension which uses Worksheet::getHighestColumn(). This latest one includes all available columns not those with effective data.

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

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

…stDataColumn() which seems to be more adequate than Worksheet::calculateWorksheetDimension which uses Worksheet::getHighestColumn(). This latest one includes all available columns not those with effective data.
@werbfred
Copy link
Author

This Pull Request is related to issue : Writer\Html output is much too large #1235

@MarkBaker
Copy link
Member

There is a block of code in the HTML Writer that tries to identify images that exist in the spreadsheet below the last data row, and to ensure that they are included in the html output. I suspect that this change would break that.
In the case of a csv file, that isn't an issue, because images aren't written to csv output

@PowerKiKi PowerKiKi closed this in f1fb8dc Jun 28, 2020
@PowerKiKi
Copy link
Member

@MarkBaker, I added tests for the case you mention and fixed the bug

@aagarwal8
Copy link

@PowerKiKi the same issue exists when there are charts or images after the last column. Can a similar fix be applied for it?

@PowerKiKi
Copy link
Member

if there is something after the last column, then it is correct to output a "too large" spreadsheet in order to show that thing, isn't it ? or are you talking about something else ?

@aagarwal8
Copy link

Perhaps, but it is not working as expected.

Spreadsheet with 6 columns, 50 odd rows; couple of charts placed over columns G thru K.
The only way HTML writer is showing the charts is if we populate a cell after column K (doesnt matter what we put in the cell; even a space works).

@PowerKiKi
Copy link
Member

What you describe is the "opposite" of OP. OP said "there is too many blank cells", but you're saying "there's not enough blank cell to see my chart". You should open a new PR to fix that, or at least a PR with a failing test that demonstrate the issue.

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

Successfully merging this pull request may close these issues.

4 participants