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

Problem with enableCellAutosizing #35

Closed
MarkoTukiainen opened this issue Sep 20, 2016 · 1 comment
Closed

Problem with enableCellAutosizing #35

MarkoTukiainen opened this issue Sep 20, 2016 · 1 comment

Comments

@MarkoTukiainen
Copy link

I found an issue that caused all the columns that had data to be effectively displayed as 0 width when turning enableCellAutosizing on. This might be related to my system locale or something similar. The $cellWidth that the sizeCalculator->getCellWidth was returning turned out to be a number with a comma as the decimal separator, such as "2,142".

I fixed the problem with a bit of a hack, by changing
$this->columnWidths[$cellIndex] = $cellWidth;

to
$this->columnWidths[$cellIndex] = str_replace(',', '.', $cellWidth);

in the updateColumnWidths method of Sheet.php. I'm sure there's a better way to do it, though.

@nimmneun
Copy link
Owner

Nice spot =) Since it's excel/spreadsheetml format which doesn't understand the commas as decimal point in the cols xml tag, the logic has been applied to the actual generation of the xml string. Thanks for reporting the issue =)

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

No branches or pull requests

2 participants