Hi PHPExcel forum!!!
I have been working with PHPExcel now for quite some time and absolutely loving it, constantly finding way to improve my work i need help/suggestions on how I can improve the 'bulky' sector of my code, please see code sector:
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing->setName('');
$objDrawing->setDescription('');
$objDrawing->setPath('../../media/catalog/product/cache/1/thumbnail/75x75/9df78eab33525d08d6e5fb8d27136e95'.$_product->getThumbnail());
$objDrawing->setCoordinates('A'.$sum_total);
$objDrawing->setOffsetX(10);
$objDrawing->setOffsetY(10);
$objDrawing->setHeight(110);
$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
$objPHPExcel->getActiveSheet()->setCellValue('A7', 'IMAGE');
$objPHPExcel->getActiveSheet()->setCellValue('B7', 'SKU');
$objPHPExcel->getActiveSheet()->setCellValue('C7', 'BRAND');
$objPHPExcel->getActiveSheet()->setCellValue('D7', 'GENDER');
$objPHPExcel->getActiveSheet()->setCellValue('E7', 'NAME');
$objPHPExcel->getActiveSheet()->setCellValue('F7', 'PRICE PER UNIT');
$objPHPExcel->getActiveSheet()->setCellValue('G7', 'RRP');
$objPHPExcel->getActiveSheet()->setCellValue('J7', 'TOTAL UNITS');
$objPHPExcel->getActiveSheet()->setCellValue('B'.$sum_total, $_product->getSku());
$objPHPExcel->getActiveSheet()->setCellValue('E'.$sum_total, $_product->getName());
$objPHPExcel->getActiveSheet()->setCellValue('C'.$sum_total, $_product->getAttributeText('manufacturer'));
$objPHPExcel->getActiveSheet()->setCellValue('D'.$sum_total, $_product->getAttributeText('gender'));
$objPHPExcel->getActiveSheet()->setCellValue('F'.$sum_total, '£'.number_format($_product->getPrice(),2));
$objPHPExcel->getActiveSheet()->setCellValue('G'.$sum_total, '£'.number_format($_product->getMsrp(),2));
$objPHPExcel->getActiveSheet()->setCellValue('I'.$sum_total, 'CLICK HERE TO BUY');
$objPHPExcel->getActiveSheet()->getCell('I'.$sum_total)->getHyperlink()->setUrl('$_product->getUrlPath());
$objPHPExcel->getActiveSheet()->getColumnDimension("A")->setWidth(23);
Here are the results:
(These two lines are externally related)
10:48:03 Collecting Product Data...
10:48:36 Data Collected...
Applying date is when the show code above starts to process
10:48:36 Applying Data to Document...
When the process finishes (5 seconds to save):
10:49:32 Writing to file
Create Writer OK
PreCalculate OK
Saving as OK
10:49:37Your file has been created
So Im looking at the roughly reducing the 1 minute processing time for the code above to be shortened if possible, at the moments its only 400+ rows in the spreadsheet baring in mind majorite is images.
I have cached it (Gzip).
If you need more info let me know and Il be happy to asist!
I have been working with PHPExcel now for quite some time and absolutely loving it, constantly finding way to improve my work i need help/suggestions on how I can improve the 'bulky' sector of my code, please see code sector:
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing->setName('');
$objDrawing->setDescription('');
$objDrawing->setPath('../../media/catalog/product/cache/1/thumbnail/75x75/9df78eab33525d08d6e5fb8d27136e95'.$_product->getThumbnail());
$objDrawing->setCoordinates('A'.$sum_total);
$objDrawing->setOffsetX(10);
$objDrawing->setOffsetY(10);
$objDrawing->setHeight(110);
$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
$objPHPExcel->getActiveSheet()->setCellValue('A7', 'IMAGE');
$objPHPExcel->getActiveSheet()->setCellValue('B7', 'SKU');
$objPHPExcel->getActiveSheet()->setCellValue('C7', 'BRAND');
$objPHPExcel->getActiveSheet()->setCellValue('D7', 'GENDER');
$objPHPExcel->getActiveSheet()->setCellValue('E7', 'NAME');
$objPHPExcel->getActiveSheet()->setCellValue('F7', 'PRICE PER UNIT');
$objPHPExcel->getActiveSheet()->setCellValue('G7', 'RRP');
$objPHPExcel->getActiveSheet()->setCellValue('J7', 'TOTAL UNITS');
$objPHPExcel->getActiveSheet()->setCellValue('B'.$sum_total, $_product->getSku());
$objPHPExcel->getActiveSheet()->setCellValue('E'.$sum_total, $_product->getName());
$objPHPExcel->getActiveSheet()->setCellValue('C'.$sum_total, $_product->getAttributeText('manufacturer'));
$objPHPExcel->getActiveSheet()->setCellValue('D'.$sum_total, $_product->getAttributeText('gender'));
$objPHPExcel->getActiveSheet()->setCellValue('F'.$sum_total, '£'.number_format($_product->getPrice(),2));
$objPHPExcel->getActiveSheet()->setCellValue('G'.$sum_total, '£'.number_format($_product->getMsrp(),2));
$objPHPExcel->getActiveSheet()->setCellValue('I'.$sum_total, 'CLICK HERE TO BUY');
$objPHPExcel->getActiveSheet()->getCell('I'.$sum_total)->getHyperlink()->setUrl('$_product->getUrlPath());
$objPHPExcel->getActiveSheet()->getColumnDimension("A")->setWidth(23);
Here are the results:
(These two lines are externally related)
10:48:03 Collecting Product Data...
10:48:36 Data Collected...
Applying date is when the show code above starts to process
10:48:36 Applying Data to Document...
When the process finishes (5 seconds to save):
10:49:32 Writing to file
Create Writer OK
PreCalculate OK
Saving as OK
10:49:37Your file has been created
So Im looking at the roughly reducing the 1 minute processing time for the code above to be shortened if possible, at the moments its only 400+ rows in the spreadsheet baring in mind majorite is images.
I have cached it (Gzip).
If you need more info let me know and Il be happy to asist!