phpspreadsheet

PhpSpreadsheet with large data

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-09 15:33:08
问题 i have a multidimensional array with 3070 Values $tbl= array( array( "KDNR" => 1, "GESCHL" => "test", "TITEL" => "test", "VORNAME" => "test", "FAMNAME" => "test", "PLZ" => "test", "ORT" => "test", "STRASSE" => "test", "EMAIL" => "test", "PRIVTEL" => "test" ), "KDNR" => 2, "GESCHL" => "test2", "TITEL" => "test2", "VORNAME" => "test2", "FAMNAME" => "test2", "PLZ" => "test2", "ORT" => "test2", "STRASSE" => "test2", "EMAIL" => "test2", "PRIVTEL" => "test2" ), etc... ); I want to write the array

Converting an html table to excel with SpreadSheet but displaying-hiding the data inside the excel file cause of the small default cells

微笑、不失礼 提交于 2020-06-26 08:44:10
问题 Everything works great my html table can succesfully converte to excel. But here is the issue. Code: $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('A1', 'Projects First Year'); $sheet->setCellValue('B1', 'Grades'); $sheet->setCellValue('A2', 'PHP Project 2020'); $sheet->setCellValue('B2', $_SESSION['phpScore']); As you can see from the example above i am saying that place the 'Projects First Year' in the cell A1, place the Grades to the cell

Converting an html table to excel with SpreadSheet but displaying-hiding the data inside the excel file cause of the small default cells

人走茶凉 提交于 2020-06-26 08:44:07
问题 Everything works great my html table can succesfully converte to excel. But here is the issue. Code: $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('A1', 'Projects First Year'); $sheet->setCellValue('B1', 'Grades'); $sheet->setCellValue('A2', 'PHP Project 2020'); $sheet->setCellValue('B2', $_SESSION['phpScore']); As you can see from the example above i am saying that place the 'Projects First Year' in the cell A1, place the Grades to the cell

PhpSpreadsheet foreach loop through multiple sheets

泪湿孤枕 提交于 2020-05-29 05:03:44
问题 I'm new to PhpSpreadsheet, I have a file with multiple sheets (all the same), I checked all the examples in the Reader section of the documentation, but each example ends with a code like $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); so seems that I can get my data only from the active sheet. I would like to loop through each sheet to get data from each one, something like: foreach ($sheetData as $sheet) { echo "...my data ..."; } Any idea? Am I missing

更换composer镜像源为阿里云

房东的猫 提交于 2020-05-02 12:27:53
​ 说一说我为什么会更换镜像源,今天我准备给公司的项目添加一个 Excel 导出的功能,需要 PhpSpreadsheet 插件来实现我的功能。输入命令发现提示我 Authentication required (packagist.laravel-china.org): ​ what?这是什么提示我需要用户名。不对啊平常都没有出现这个问题。我就去查百度了发现原来 laravel-china 的 package 镜像站将要停止运营了,这个消息并不是很好。用了很久的镜像站了,非常不错。哎,人家也坚持了两年已经很不错了。没办法我只能更换了。下面是我更换为阿里云镜像的操作步骤: 官网: https://developer.aliyun.com/composer 全局替换 $ composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ $ composer clear-cache # 此步奏选泽性操作,清除所有 package 缓存。 当前项目替换 $ cd 项目目录 $ composer config repo.packagist composer https://mirrors.aliyun.com/composer/ 来源: oschina 链接: https://my.oschina

How can I resolve “Allowed memory size exhausted” error?

你。 提交于 2020-04-07 05:05:17
问题 I´m working with phpspreadsheet and I want to modify an xlsx file with 4 sheets. I only want to insert data in 2 sheets, but I want to copy all 4 sheets to the new xlsx file. When I do that I get this error: Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) This is because one of that sheets is to heavy, but that heavy sheet I only want to copy it, not modify it. I have tried loading this: ini_set('memory_limit', -1); But it doesn´t work for me,

How can i print array as row and column in phpExcel?

假装没事ソ 提交于 2020-03-28 06:39:09
问题 Here is my array output in browser which i need to print as row and column associatively in PHPEXCEL.Please suggest me how to export it as row and columns. FirstArray ( [0] => EY>Yes [1] => Media Type>Category B [2] => Coverage Type>Quote [3] => Industry Programs>Communications [4] => Score>1 ) code - while ($i < count($labels)) { $j = 0; while ($j < count($dd1)) { // for($j=0;$j<count($dd1);$j++) { $temp = explode(">", $dd1[$j]); if ($temp[0] == $labels[$i]) { $name = explode(">", $dd1[$j]);

PHPExcel: Dynamic Row and Column incrementing is not working for Array in phpexcel?

这一生的挚爱 提交于 2020-03-06 09:30:22
问题 While printing column and row from an array it's showing blank not exporting any data $inn_table = ""; if ($result['qualification']['dd1'] != "") { $dd1 = explode(",", $result['qualification']['dd1']); } if ($result['qualification']['dd2'] != "") { $dd2 = explode(",", $result['qualification']['dd2']); } for ($i = 0; $i < count($labels); $i++) { if ($result['qualification']['dd1'] != "") { echo '<pre>First'; print_r($dd1); ** //echo arrays** for ($j = 0; $j < count($dd1); $j++) { $temp =

Phpspreadsheet - Time cell retrieved as float

前提是你 提交于 2020-01-30 09:50:29
问题 I have an excel file which has a time input. Mar 01, 2018 | Thursday | 8:00 AM | 5:00 PM Mar 02, 2018 | Friday | 8:00 AM | 5:00 PM But when my code tries to read those cells, the output becomes a float (for example 8:00 AM becomes 0.33333333333333 ). This is my code $date = $sheet->getCell("A".$row)->getValue(); $time_in = $sheet->getCell("C".$row)->getValue(); $time_out = $sheet->getCell("D".$row)->getValue(); echo "date: ".$date. //Mar 01, 2018 " time_in: ".$time_in. //becomes 0

phpspreadsheet working on local but not on live

送分小仙女□ 提交于 2020-01-06 04:32:31
问题 I installed phpspreadsheet with composer in my Codeigniter project. It's working fine on local but throwing an error on the live environment: This site can’t be reached The webpage at http://www.xxxxxx.com/email/exportemail might be temporarily down or it may have moved permanently to a new web address. ERR_INVALID_RESPONSE My code: require(APPPATH . 'vendor/autoload.php'); use PhpOffice\PhpSpreadsheet\Helper\Sample; use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet