0

I have a formatted and styled xls file with dummy data on my server. I want to use this file as a base for all of my exports. I want to replace the dummy data with real one at the time of export with php.


I have read about phpoffice library, but I am not sure how should I proceed with that. How should I write to xls and replace dummy data while maintaining the original format and styles.

Beru
  • 657
  • 1
  • 6
  • 21
  • 1
    Mind sharing your work with us? We love to help however we're not a code writing service. – Beru Jul 26 '19 at 09:39
  • @GentleSama Rather you can say this question is more like opinion based. I am not asking someone to write a solution for that problem :) – Vishal Suthar Jul 26 '19 at 09:52
  • You can do this with PHPSpreadsheet, there's an example in the documentation: https://phpspreadsheet.readthedocs.io/en/latest/topics/reading-and-writing-to-file/#generating-excel-files-from-templates-read-modify-write Be aware though that PHPSpreadhseet reads and holds the entire document in memory, so if you have large spreadsheets you will probably exhaust the available memory if you're manipulating files in an HTTP lifecycle. If that's the case, you may need to do something like set up PHP JAVA Bridge and use the Apache POI library's streaming model. – Rob Ruchte Jul 27 '19 at 04:16

0 Answers0