phpexcel

How to save excel file using phpexcel

偶尔善良 提交于 2019-12-12 02:39:37
问题 I am writing some code to open an excel file then creating a new column and appending the data from column 2 to column 1. However the file is not saving. I am loading this data in my local Wamp. The project is in Laravel // create new file with results $date = new \DateTime(); // create new file with results $date = new \DateTime(); $directory = base_path() . '/storage/tmp/'; /** Load $inputFileName to a PHPExcel Object **/ $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); foreach (

PHPExcel Sum with skipped columns [duplicate]

泄露秘密 提交于 2019-12-12 02:34:34
问题 This question already has an answer here : PHPExcel Sumif and Skip (1 answer) Closed 6 years ago . I just want to ask how can I sum columns horizontaly, skipping every 1 column? Here's the screenshot. I just want to sum D9 and F9 only whic is the Branch Code. I want to disregard the column "r" which means rank. Please take note that the number of columns is dynamic, there are possibilities that that there are 6 Branches with also 6 branch. Their values will be on the same row, how can I sort

PHPExcel download as zip file

匆匆过客 提交于 2019-12-12 02:14:48
问题 I have this code and works fine downloading with excel file with PHPExcel and CI but I want to download it as zip file and inside of it is the excel file. $header = array( 'foodgroup','energy','protein','fat','cho','calcium','iron','thiamin','niacin','vitamin_c' ,'vitamin_a', ); require_once APPPATH."/third_party/PHPExcel.php"; $sheet = new PHPExcel(); $file = $this->dietary_model->getById($subject_id,'dietary_subject'); $filename = $file->name; $this->load->helper('date'); $date = date('Y-m

PHPExcel - Preserve rich text format on import

↘锁芯ラ 提交于 2019-12-12 01:32:08
问题 A component of a project I am working on is to import text in cells from Excel using PHPExcel as a quicker way to populate the MySQL database. How can I achieve preserving the Rich Text formatting of the Cell Contents e.g. "The Quick Brown Fox ". I am guessing it would require parsing the content-format somehow into matching HTML tags? Is there a way to achieve this in PHPExcel? Thanks! 回答1: It's mentioned in the documentation. $objRichText = new PHPExcel_RichText(); $objRichText->createText(

phpexel and codeigniter getting error

纵饮孤独 提交于 2019-12-12 01:19:27
问题 I get everything as described on this link: http://www.ahowto.net/php/easily-integrateload-phpexcel-into-codeigniter-framework, but I got this in my excel file (I used example from site where is tutorial): http://img11.imageshack.us/img11/7017/errorfzh.jpg And my controller: class Mail extends CI_Controller { public function __construct(){ parent::__construct(); $this->load->library(array('form_validation', 'excel')); //activate worksheet number 1 $this->excel->setActiveSheetIndex(0); //name

PHPExcel help - How to Export data with PHPexcel in an custom table layout

泄露秘密 提交于 2019-12-11 20:34:57
问题 I am quite new to PHPExcel and learning PHP as I go. I managed to get PHPexcel to export my data from SQL via the code below. Right now its just outputting in basic style, meaning its just serialized the data from SQL and next record would show up in the next row. I added an image of what I would like to accomplish, is this something possible with PHPexcel or am I dreaming. If anyone could send me a quick example of how to accomplish this it would be greatly appreciated. Image http://postimg

Set data type in the php excel in column level

时间秒杀一切 提交于 2019-12-11 17:49:38
问题 I am using PHPExcel and using fromArray I have added the vales to the cells. Now I want to set the data type of certain cells as string. Some columns are having specific type of values (e.g numeric or dates or text). Using string data type is more than enough for this purpose otherwise digits with length more than 12 are showing with exponential E and leading zeros are truncated . I found how to set the data type per specific cell programmatically when setting a value in a cell. However how

creating bold text/cells with PHPExcel

这一生的挚爱 提交于 2019-12-11 17:28:39
问题 im trying to bold text but im failing to do so, for a reason i realy dont know, i have followed steps in the documentation of PHPExcel, but to no result, here is my code: require_once './classes/PHPExcel.php'; Create new PHPExcel object $objPHPExcel = new PHPExcel(); include('./classes/PHPExcel/Writer/Excel5.php'); $objPHPExcel->getActiveSheet()->mergeCells('A1:k1'); $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(25); $objPHPExcel->getActiveSheet()->getColumnDimension('B')-

unable to upload an excel file in codeigniter

我怕爱的太早我们不能终老 提交于 2019-12-11 12:57:31
问题 I have a Codeigniter project that can insert data into database through uploading an excel file and reading it with PHPExcel. It is working on my localhost however when I uploaded it in a LAMP server, It gives me an error The filetype you are attempting to upload is not allowed. How am I going to solve this? EDIT In my project, I also have a file image uploading.. public function uploadConfig(){ $this->load->library('PHPExcel'); $this->load->library('PHPExcel/IOFactory'); $config['upload_path

PHPEXCEL getCalculatedValue or getFormattedValue returns fatal error

前提是你 提交于 2019-12-11 10:48:01
问题 I have a file with mime-type "application/octet-stream; charset=binary" and extension ".xlsx". PHPExcel_IOFactory::identify($this->file) returns 'Excel2007'. I create my reader like this: $this->objectReader = PHPExcel_IOFactory::createReaderForFile($this->file); When I try to get a cell value with a formula I can only do it in two ways: 1)$sheet->getCell($columns[$i].$row->getRowIndex())->getValue() //return the actual formula as a string 2)$sheet->getCell($columns[$i].$row->getRowIndex())-