-1

I have loaded the library and gotten the sample code to work. The problem is I don't see or read anywhere how to turn off the screen output for the 46_ReadHtml.php

This is output that I need to turn off:

19:37:47 Read Html format from C:\oerm_dev\www\dev\mindfulemr3\vendor\phpoffice\phpspreadsheet\samples\Basic/../templates/46readHtml.html in 0.2000 seconds
19:37:47 Write Xlsx format to C:\Windows\TEMP/phpspreadsheet/46_ReadHtml.xlsx in 0.0550 seconds
19:37:47 Write Xls format to C:\Windows\TEMP/phpspreadsheet/46_ReadHtml.xls in 0.0390 seconds
19:37:47 Peak memory usage: 4MB

Could someone point me to the documentation of how to turn this off?

There is nothing on the website about the sample files and how they work.

https://phpspreadsheet.readthedocs.io/en/develop/topics/reading-and-writing-to-file/

user1794918
  • 1,131
  • 2
  • 16
  • 34

1 Answers1

0

SOLUTION:

I figured out what to do when @PowerKiKi

https://gitter.im/PHPOffice/PhpSpreadsheet?at=5a42a228e43a7a150caab463

suggested that I look at the link above again. The hint was all the way at the bottom. I added this.

 //$helper->write($objPHPExcel, __FILE__);
 $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($objPHPExcel, 'Xlsx');
 $writer->save('payroll.xlsx');

Commented out all the helper variables and replaced the last line with a call to the object writer. Once the object reader read in the file

 $objReader->load($html);

The writer needed to be instantiated to and told to write an xlsx file from the html that had been load into the object variable

 $objPHPExcel.

Hope this helps someone out there. If it helps you please add an upvote.

user1794918
  • 1,131
  • 2
  • 16
  • 34