aVadim483 / fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP
MIT License
163 stars 31 forks source link

Save File when cell value has formula #37

Closed lvlightvivian closed 12 months ago

lvlightvivian commented 12 months ago

Hi I try to export a formula sheet and upload to googlesheets. but formula cell not works correctly. It just show formula string, not formula execute result.

so I unziped xlsx, found sheet.xml. the formula cell value like this: <c r="C4" s="0"><f>=SUM(C1:C3)</f></c>

and I try to check other xlsx file download from googlesheets <c r="B4" s="2"><f t="shared" ref="B4:C4" si="2">SUM(B1:B3)</f><v>2004</v></c> I found the formula cell value not contain '=' on first char

I modified Writer.php Line 996 to remove '=' $file->write('' . mb_substr(self::xmlSpecialChars($value), 1) . ''); and It works fine

thank you

aVadim483 commented 12 months ago

Thanx for report, I'll check this