phpexcel

PHPExcel Writes Junk characters when running the code on AWS.

﹥>﹥吖頭↗ 提交于 2019-12-10 17:53:02
问题 I am facing problem with PHPExcel excel download code.A download code which is working on one server (netcore server) but same set of code not working on AWS server.can any one help me to figure out what could be the exact issue?? following is the phpexcel download code : error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); date_default_timezone_set('Europe/London'); if (PHP_SAPI == 'cli') die('This example should only be run from a Web Browser');

exporting large files to excel using PHPExcel

陌路散爱 提交于 2019-12-10 17:16:10
问题 I am trying to export around 40,000 rows of Mysql data in PHP(Laravel4) using PHPExcel library. Below is my code: ($patList is an array of result columns) set_time_limit ( 3000 ); $cacheMethod = PHPExcel_CachedObjectStorageFactory:: cache_to_phpTemp; $cacheSettings = array( 'memoryCacheSize' => -1); PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); $objPHPExcel = new PHPExcel(); $i = 1; $patList = $result[0]; for ($r = 0; $r < count($patList); $r++) { $objPHPExcel-

PHPExcel XLSM file with macros

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 16:16:46
问题 Is it possible to read and write xlsm with macros file with phpexcel? I tested this code just to replicate the original file: $objReader = PHPExcel_IOFactory::createReader('Excel2007'); $objPHPExcel = $objReader->load("file1.xlsm"); echo ('Saving...'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter->save('test.xlsm'); header('Cache-Control: max-age=0'); But the new file is different from the original because he has no images. Thank you. 回答1: PHPExcel

Fatal error: Out of memory (allocated 1979711488) (tried to allocate 131072 bytes) error occur while writing xlsx file using phpexcel

五迷三道 提交于 2019-12-10 15:41:55
问题 I have integrating xlsx file for writing from database using phpexcel. I want to write 3,00,000 records in xlsx file. But it till through Fatal error: Out of memory (allocated 1979711488) (tried to allocate 131072 bytes) My PHP Version 5.3.28 Also i set php ini and cell cache see my code below ini_set('max_execution_time',-1); ini_set('memory_limit', '-1'); $cacheMethod = PHPExcel_CachedObjectStorageFactory:: cache_in_memory_gzip; $cacheSettings = array( ' memoryCacheSize ' => '-1'); PHPExcel

Php excel formula not running in saved spreadsheet

自古美人都是妖i 提交于 2019-12-10 15:36:42
问题 I'm using php excel codeplex, I'm filling a cell like this: $objWorksheet->setCellValue('B12', "='Other sheet'!D38"); I save the file successfully, when I open it the formula is there, but it doesn't render the calculated value. If I copy and paste the formula to another cell it runs ok, so, it's not a problem of the formula's syntax. How can I force the formula to execute before saving? I have tried: \PHPExcel_Calculation::getInstance($objPHPExcel)->disableCalculationCache(); \PHPExcel

Laravel Excel: how to get value of a cell?

血红的双手。 提交于 2019-12-10 15:19:39
问题 I've loaded .xls file with Laravel Excel: Excel::load('public/files/20160621.xls', function($reader) { // read a cell value }); How do I read values of cells of the loaded excel file? Documentation seems to be unclear on that part. 回答1: public function get() { $excelFile ... return Excel::load($excelFile, function($doc) { $sheet = $doc->getSheetByName('data'); // sheet with name data, but you can also use sheet indexes. $sheet->getCell('A1'); $sheet->getCellByColumnAndRow(0,0); }); } You're

PHPExcel: How to insert an image in the first page header and enlarge it to fit it's content?

穿精又带淫゛_ 提交于 2019-12-10 15:12:51
问题 I have an Excel file made with PHPExcel which have an header with a left aligned logo and right aligned date & user text. For the first page, I want a similar header (same logo and same date & user text) but with some added information (title and parameters of the file centered a couples lines later). This is what I'm doing so far: <?php $sheet = $this->_spreadsheet->getActiveSheet(); //_spreadsheet is an instance of PHPExcel $logo = new PHPExcel_Worksheet_HeaderFooterDrawing(); $logo-

Is there a way to detect if an excel file was generated on windows or mac using PHPExcel?

岁酱吖の 提交于 2019-12-10 14:34:27
问题 I'm using PHPExcel to generate a xls template that the user can download and fill it with the data he wants. As we know, excel saves the date in a numeric format. I'm using this function to convert the data and return the timestamp: public static function excelToTimestamp($excelDateTime, $isMacExcel=false) { $myExcelBaseDate = $isMacExcel ? 24107 : 25569; // 1st jan 1904 or 1st jan 1900 if (!$isMacExcel && $excelDateTime < 60) { // Adjust for the spurious 29-Feb-1900 (Day 60) --

php_excel07- How to make grow the height of cell based on cell data(xls)

≯℡__Kan透↙ 提交于 2019-12-10 13:56:15
问题 In my application i need to export to xls file in a predefined format. so I just integrated php_excel2007 . I am using one template with a predefined format. The problem here is the cell data may change dynamically. if data is much bigger than cell height then data is collapsing. So is ther anyway to increase the height of cell based on content of the cell(in XLX not xlsx)? 回答1: The only way is as described in this answer to your previous question on this topic: setting the row height to

PHPExcel: Invalid cell coordinate error

ぐ巨炮叔叔 提交于 2019-12-10 13:52:46
问题 I'm extending a controller in CodeIgniter that handles PHPExcel. So far, I've not gotten anywhere near column Z, until now. Having arrived, I'm greeted with: Fatal error: Uncaught exception 'Exception' with message 'Invalid cell coordinate AA' in /PATH/phpexcel/PHPExcel/Cell.php:513 Stack trace: #0 /PATH/phpexcel/PHPExcel/Worksheet.php(1119): PHPExcel_Cell::coordinateFromString('AA') #1 /PATH/phpexcel/PHPExcel/Worksheet.php(1022): PHPExcel_Worksheet->getCell('AA') #2 /PATH/application/modules