Open Seb33300 opened 2 months ago
It doesn't disable formulas, it precalculates the result. Because the string starts with =
PhpSpreadsheet will automatically detect the data type as a formula and insert it as such. You'll have to mark the value as string, by customizing the default value binder: https://docs.laravel-excel.com/3.1/imports/custom-formatting-values.html#value-binder
Thanks for the information.
I wish we could have a way to disable formulas globally. It feels a bit cumbersome to override the default value binder in every export that may include user text data (literally all of our exports...)
You can configure a custom value binder in your config as mentioned in the docs: https://docs.laravel-excel.com/3.1/exports/column-formatting.html#default-value-binder
Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?
What version of Laravel Excel are you using?
3.1.56
What version of Laravel are you using?
11.20.0
What version of PHP are you using?
8.2.13
Describe your issue
The
pre_calculate_formulas
option is set to false in myconfig
file:If I understand properly, this option is intended to disable formula during exports?
But I still get the following error when exporting data from a collection:
Content of cell
AI7
is a string starting by==
looking like this:How can the issue be reproduced?
Set the
pre_calculate_formulas
option tofalse
and try to export a string starting by==
What should be the expected behaviour?
The cell should be exported as string.