exactly @jimmck as the previous code i wrote showing how i export to excel
Sorry, I don't know how you write to excel. Which library is it?
I'm surprised it uses table cells? Is there not a fromArray method?
@Snapey the library is called Maatwebsite i think i saw before fromArray but i was unable to use it that way
and don't know what is the difference
in my case how i can write fromArray method ?
@Snapey guess what i use from array like this
$province=Province::with('country')->orderBy('name','ASC')->get();
Excel::create($this->reportTitle, function($excel) use ($province) {
$excel->sheet($this->reportTitle, function($sheet) use ($province) {
$provinces=$province->toArray();
$sheet->fromArray($provinces);
});
})->download('xls');
it takes double time when using fromArray !!!
http://www.maatwebsite.nl/laravel-excel/docs/export#array
you just need to concentrate on getting your data from the collection with relationships into a plain array.
I would have thought this would be a lot quicker than rendering a view as html and then asking phpExcel to import it as html and convert to cell data?
@Snapey using fromArray method as above took 1.4 minutes while rendering view as html took 41 seconds !!
wow. I render a 256 page PDF with 2500 names and addresses in less time than that. Something is not right....
@Snapey The OP needs to better understand their tools. Like you I write directly using PHPOffice Excel with no problems.
Please or to participate in this conversation.