2

I'm looking for a server-side (PHP) way of manipulating / producing xls / xlsx files from MySQL data.

I have an existing template xls file, with various relatively complicated cell dependant formulas and charts and such included, my hope is that I can upload this template file to my server and use PHPExcel to edit that file, and save it: allowing it to be downloaded.

So my formulas are kept, the charts are kept, and I simply have to edit the data for certain cells based on values from the database --> charts drawn based on these values.

Is that kind of thing within PHPExcels remit?

Reading a related question here: PHPExcel modify existing .xlsx file with multiple worksheet

Someone stated:

Macros and User-Defined Functions are not supported in PHPExcel; and the library discards any unsupported features of a workbook when it is loaded, so they don't exist in the PHPExcel object at all... when saving, PHPExcel only saves those elements of the workbook that exist in the PHPExcel object.

Would a user defined function include simple cell formulas?

Thanks!

Community
  • 1
  • 1
Gideon
  • 1,878
  • 4
  • 40
  • 71

2 Answers2

2

No. Simple cell formulas will still be there. Just not any VBA code.

Ethan
  • 2,754
  • 1
  • 21
  • 34
2

PHPExcel can handle quite complex cell formulae, though it does have some limitations:

  • Only 316 out of 356 functions for Excel 2007 are currently supported, and those that are don't necessarily implement all features of the function
  • None of the additional functions for Excel 2010 and Excel 2013 are supported
  • Analysis toolpack functions aren't support for Excel BIFF files
  • VBA script is not supported, this includes any user-defined functions
  • Array formulae aren't supported
  • 3D-cell references are not supported
Mark Baker
  • 209,507
  • 32
  • 346
  • 385