A
A
Alexey Alyushenko2014-04-22 02:46:05
PHP
Alexey Alyushenko, 2014-04-22 02:46:05

How to open-edit-save large xls?

Hello.
There is a template file in xls format on the server, I need to open it, enter data into it and save it under a different name and send it for download. But! Since the file is 590 kb my server cannot process it.
I found an article , but, as I understand it, this code can only read the data, but not save it, or am I wrong?
Actually a question: How to solve this problem? Or how to change the code given in the article so that it can save?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
switlle, 2014-04-22
@switlle

I recently answered a question about recording. Unfortunately my code only writes large files. But he does it very quickly.
Answer read here:
How to export a large table to Excel using PHP?

E
Evgeny Komarov, 2014-04-22
@maNULL

I do like this:

require_once '../lib/PHPExcel.php';
require_once '../lib/PHPExcel/IOFactory.php';
$pExcel = PHPExcel_IOFactory::createReader('Excel2007');
$pExcel = $pExcel->load('../template/report_full_information.xlsx');
$pExcel->setActiveSheetIndex(0);
$aSheets = $pExcel->getActiveSheet();
/*пишем в файлик все, что нужно через $aSheets->setCellValue()*/
$objWriter = PHPExcel_IOFactory::createWriter($pExcel, 'Excel2007');
$file = "filename.xlsx";
$objWriter->save('../export/'.$file);

The input file is 105kb, the output is 4.6mb. File generation time on my hardware is about 3 minutes. Long, but there's nothing to be done

Y
Yuri Denisov, 2014-04-22
@denissov

try openbs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question