phpexcel

PHPExcel is showing error on Remote Server

流过昼夜 提交于 2019-12-24 06:47:06
问题 I am using PHPExcel in my php classes to generate a xls file. Code is perfectly working on my localhost but showing errors on remote server. Errors are : <br /> <b>Warning</b>: include(inc/classes/PHPExcel_Shared_String.class.php): failed to open stream: No such file or directory in <b>/home/example/../index.php</b> on line <b>13</b><br /> <br /> <b>Warning</b>: include(): Failed opening 'inc/classes/PHPExcel_Shared_String.class.php' for inclusion (include_path='.:/usr/share/pear:/home

How to convert *.xlsb to array or *.csv using php

為{幸葍}努か 提交于 2019-12-24 05:45:28
问题 I am trying to convert *.xlsb file into php array or *.csv file (or at least *.xls ). I tried to use PHPExcel , but looks like it can not recognize what's inside this file. I noticed, that you can rename *.xlsb file into *.zip file and then unzip it using command line unzip *.zip . And after this you will get next folders with sheet1.bin file: Looks like this file should contain Excel cell values, but I still can not parse it using PHPExcel . Can someone help me is it even possible to parse *

PHPExcel 1.8.0 - Creating many sheets by cloning a template sheet gets slower with each clone

不想你离开。 提交于 2019-12-24 03:15:25
问题 I am working on a reporting tool using PHPExcel 1.8.0. I need to constantly clone template sheets and fill them with data. The first sheets are generated very fast, but this process gets slower and slower with each sheet cloned. Here is the code i use for cloning sheets: $resultSheet = clone $sourceSheet; // instance of PHPExcel_Worksheet $resultSheet->setTitle($newSheetName); $sourceSheet->getParent()->addSheet($resultSheet,0); $sourceSheet->getParent()->setActiveSheetIndex($sourceSheet-

Store PHPExcel files in Amazon S3

断了今生、忘了曾经 提交于 2019-12-24 03:08:13
问题 I have an application that creates a lot of Excel files, which I would like to store in Amazon S3 for later use. $objPHPExcel = PHPExcel_IOFactory::load('template.xlsx'); $objPHPExcel->getActiveSheet()->getCell('A1')->setValue('SomeVal'); // ... $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter->save('filename.xlsx'); This is the code I usually use to save the files, but I dont't want to store the files on my application server, so I am going to store these

Store PHPExcel files in Amazon S3

守給你的承諾、 提交于 2019-12-24 03:08:08
问题 I have an application that creates a lot of Excel files, which I would like to store in Amazon S3 for later use. $objPHPExcel = PHPExcel_IOFactory::load('template.xlsx'); $objPHPExcel->getActiveSheet()->getCell('A1')->setValue('SomeVal'); // ... $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter->save('filename.xlsx'); This is the code I usually use to save the files, but I dont't want to store the files on my application server, so I am going to store these

PHPExcel - How to replace text using preg_replace

徘徊边缘 提交于 2019-12-24 02:56:41
问题 I am using PHPExcel to extract data from my database onto an organized Excel sheet. Everything is working great except for one thing. My database entries can sometimes contain HTML markups like <strong></strong> , <BR> , <p></p> etc ... So I managed to get this PHP line working, this is working great to replace my <BR> markups to a space. $data = str_replace("<br />", "\n", $data); $data = str_replace("<br/>", "\n", $data); $data = str_replace("<br>", "\n", $data); However when I try doing

PHPExcel $objWriter->save() fails

纵饮孤独 提交于 2019-12-24 00:59:01
问题 I am creating an Excel file based on records from a database with PHPExcel and am facing an odd problem when generating it on a large data set. I have narrowed it down to a single problem-causing line: $objWriter->save('php://output'); It just spits out a blank file instead of the expected workbook. Also, the effect is similar if I try to save the result into a local file instead of redirecting to the browser - no file is ever created. The kicker is that it works perfectly for a smaller data

PHPExcel: Custom font?

风流意气都作罢 提交于 2019-12-24 00:58:44
问题 Is there a way to embed a font to the xls and use it with PHPExcel? I want custom font because I want to use barcode font in the excel. I tried to embed a barcode image but random dot appears when printing and the barcode scanner cannot read it. 回答1: There isn't. Excel relies on the range of fonts that exist on the client PC where the Excel document is opened. Where a font doesn't exist, it will fall back to members of the font family that exist on that client PC. In the case of a font

Most effective way to create Excel files

好久不见. 提交于 2019-12-24 00:15:03
问题 Looking for a PHP solution to create Excel files on the fly (Think dynamic reporting). Now I have seen PHP Excel and I know I can create a CSV file but are these by best options? I running this script on a Linux system using PHP Excel but it doesn't set all the options $objPHPExcel->getProperties()->setCreator("Phill"); $objPHPExcel->getProperties()->setLastModifiedBy("Phill"); $objPHPExcel->getProperties()->setTitle("Office 2007 XLSX Test Document"); $objPHPExcel->getProperties()->setSubject

Setting Column Width with PHPExcel Not Working

耗尽温柔 提交于 2019-12-23 21:23:20
问题 I am trying to format the cell widths of a document that I am creating with PHPExcel, yet when I use the getColumnDimension('A')->setWidth(7) method, it is not being produced accurately in the generated xlsx file. I formatted the document in Excel so that I could find the values of the cells that I want and I get two values, one in Excel Units and the other in Inches. For example: $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth('7'); will end up giving me a column width of 6