phpexcel

Using PHPExcel to make automatic generated excel files

半世苍凉 提交于 2020-12-27 18:49:42
问题 I want to have my excel file filled with some data which I get from my database, for example the name and age of someone. Say there are 10 people in my database. I want those 10 people in my Excel file. So basically, you would get: NAME AGE Person1 20 years Person2 25 years And so on. I know how to set the NAME and AGE stuff, but how would I go about looping the data and writing it inside the excel file? I couldn't find anything about it in PHPExcel's documentation. This is my MySQL: $query =

getHighestDataColumn on phpexcelspreadsheet as count in php [duplicate]

只愿长相守 提交于 2020-08-10 18:51:48
问题 This question already has answers here : PHPExcel how to get column index from cell (3 answers) Closed 27 days ago . I am using https://phpspreadsheet.readthedocs.io/en/latest/ phpspreadsheet to import files to database.I need to get the total number of columns in the uploaded excel before importing it to database. I found getHighestDataColumn() which returns the highest coulmn as alphabets. $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($fileName); $worksheet = $spreadsheet-

getHighestDataColumn on phpexcelspreadsheet as count in php [duplicate]

折月煮酒 提交于 2020-08-10 18:50:24
问题 This question already has answers here : PHPExcel how to get column index from cell (3 answers) Closed 27 days ago . I am using https://phpspreadsheet.readthedocs.io/en/latest/ phpspreadsheet to import files to database.I need to get the total number of columns in the uploaded excel before importing it to database. I found getHighestDataColumn() which returns the highest coulmn as alphabets. $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($fileName); $worksheet = $spreadsheet-

phpexcel add column dynamically

落花浮王杯 提交于 2020-07-22 21:35:50
问题 $mysqli = new mysqli("localhost", "root", "", "wolly"); if ($mysqli->connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit(); } $query = "SELECT * FROM action"; if ($result = $mysqli->query($query)) { while ($row = $result->fetch_assoc()) { $objPHPExcel->getActiveSheet()->setCellValue('A1', $row["ActionId"]); $objPHPExcel->getActiveSheet()->setCellValue('B1', $row["ActionName"]); } $result->free(); } $mysqli->close(); By the above query it will print only in the A1, B1

phpexcel add column dynamically

╄→гoц情女王★ 提交于 2020-07-22 21:35:40
问题 $mysqli = new mysqli("localhost", "root", "", "wolly"); if ($mysqli->connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit(); } $query = "SELECT * FROM action"; if ($result = $mysqli->query($query)) { while ($row = $result->fetch_assoc()) { $objPHPExcel->getActiveSheet()->setCellValue('A1', $row["ActionId"]); $objPHPExcel->getActiveSheet()->setCellValue('B1', $row["ActionName"]); } $result->free(); } $mysqli->close(); By the above query it will print only in the A1, B1

Why am I getting an “invalid or unitialized Zip object” error when trying to read excel file via PHP?

我怕爱的太早我们不能终老 提交于 2020-07-17 06:33:55
问题 I would like to find out how to read an excel file using via PHP. My specific use case is using PHPExcel from within Yii. I have followed numerous tutorials and I am always stuck at one point: "ZipArchive::getFromName(): Invalid or unitialized Zip object". I have added the extensions, loader, etc. but nothing seems to be working. is there any way around this? or do I need to get another library? Here is the code in my controller. Yii::import('application.vendors.PHPExcel.PHPExcel',true);

Why am I getting an “invalid or unitialized Zip object” error when trying to read excel file via PHP?

雨燕双飞 提交于 2020-07-17 06:31:57
问题 I would like to find out how to read an excel file using via PHP. My specific use case is using PHPExcel from within Yii. I have followed numerous tutorials and I am always stuck at one point: "ZipArchive::getFromName(): Invalid or unitialized Zip object". I have added the extensions, loader, etc. but nothing seems to be working. is there any way around this? or do I need to get another library? Here is the code in my controller. Yii::import('application.vendors.PHPExcel.PHPExcel',true);

A non-numeric value encountered in phpexel

孤街浪徒 提交于 2020-06-29 20:45:19
问题 Im getting A non-numeric value encountered in xls file when I use Auto filter ,Im using PHPExel package. My opertaing system is ubantu 16.04. Using Libreoffice to view the files. My code <?php $objPHPExcel = new PHPExcel(); $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Date'); $objPHPExcel->getActiveSheet()->setCellValue('B1', 'Invoice'); $objPHPExcel->getActiveSheet()->setCellValue('C1', 'Client'); $row = 2; foreach ($values['results'] as $value) { $objPHPExcel->getActiveSheet()-

A non-numeric value encountered in phpexel

强颜欢笑 提交于 2020-06-29 20:44:34
问题 Im getting A non-numeric value encountered in xls file when I use Auto filter ,Im using PHPExel package. My opertaing system is ubantu 16.04. Using Libreoffice to view the files. My code <?php $objPHPExcel = new PHPExcel(); $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Date'); $objPHPExcel->getActiveSheet()->setCellValue('B1', 'Invoice'); $objPHPExcel->getActiveSheet()->setCellValue('C1', 'Client'); $row = 2; foreach ($values['results'] as $value) { $objPHPExcel->getActiveSheet()-