-
-
Notifications
You must be signed in to change notification settings - Fork 636
Excel .xlsx writer make all cells TEXT #261
Comments
This is not supported yet and won't be until Spout supports per-cell styling (which is planned in v3). As far as I know, there are no workarounds for it unfortunately. You'll have to fork and implement it yourself if you want support for that. |
Can you lead me to which file to fork? Chris Muench On Jul 6, 2016, at 4:51 AM, Adrien Loison notifications@github.com wrote: This is not supported yet and won't be until Spout supports per-cell — |
You can look at #209, it does something a bit similar |
I achieved this by accident, as I was reading all the data from a database and the data type was always text. I actually had to cast the numbers from strings to get numbers in Excel. |
I solved it by doing the following
|
@bevhost, you can also explicitly cast variables like this: $string = (string)$foo;
$int = (int)$foo;
... @blasto333 You may have other problems changing the |
This can now be solved thanks to #668. You can style your cell/row using |
Hey @adrilo .. Can we set the format as Text now? if yes can you please share a code snippet? |
Using '@' in format seems to be working fine and doesn't changes the data in excel.
|
I am and am trying to figure out how to make all cells written in text format and NOT general. It doesn't seem to be possible. The reason being is if a user edits a cell I want it to be exactly as the typed and NOT have excel guess what it is. (Converting 10% --> 10% as a PERCENT; when I read this back it is .1 and not 10%)
in phpExcel I am able to do:
to force all cells as text.
Is there a way to do this in spout (I couldn't find in docs)? I like spout better because it is faster and uses less memory.
Even if I have to come up with a crazy hack; I am all for it.
The text was updated successfully, but these errors were encountered: