ask about PHPExcel

hello.

hmm… i think this isn’t about yii…but i wanna ask,about PHPExcel,

i follow the instructions from this wiki http://www.yiiframework.com/wiki/101/how-to-use-phpexcel-external-library-with-yii/

hmm… that demo is work but load really heavy…(eating the server memory)

are this is because PHPExcel ?

i wanna use this,but its make my apache unrespons…

help

thanks

Are you sure that is php excel the problem?

Consider that huge report (more than 1000 records) are better to be done without AR, using DAO or the queryBuilder.

Also phpExcel can be very slow managing big files, better to export a simle csv and your user will open with excel.

when i try generates all my worksheet to pdf(just 3) ,the memory is exhausted…

but you are right if i generates an xls it’s not that heavy…

i generates 1 worksheet to pdf and echo (memory_get_peak_usage(true) / 1024 / 1024).‘MB’;

woah its use 25MB memory,damn it’s big…

and my apache service stop suddenly,when i use PHPExcel many times…

What for to do such a work, propose your client a 50% 50% solution:

Small export -> excel

Big export -> csv (and they can optionally open in excel).

The conversion excel to pdf is really heavy, is not an option. If you have to create a pdf is better to use fpdf, but you will be forced to create an hardcoded solution (no template in excel).

i need the template from excel,but i need to generates to pdf or a file which can print all pages easily…because not just 1 page to be printed but many…

i think im going to use fpdf like your suggestion…

thanks brother

I had your same problem.

Nice technologies are expensive: is nice to have a template in excel and then print in pdf, but is too expensive.

I can give you another suggestion:

Once we did some contract’s generation, and we used rtf as template. The customer prepared with word a template in rtf, with some magic words that we substitute.

Rtf is a plain text file, you can freely substitute all with preg_replace, it work great.

Unfortunalely you cannot use this for large table.