phpexcel

Ignoring calculated values when reading in Excel file with PHPExcel

瘦欲@ 提交于 2019-12-12 11:11:01
问题 I am reading an XLS file with setReadDataOnly(true). The read object is saved again as a new Excel file. Unfortunately, some cell values are calculated incorrectly (this has to do with a calculation bug over cells with a subtotal formula). If I understand correctly, each cell in an XLS file contains a pre-calculated value along with the formula. If I can get PHPExcel to not attempt to calculate the formulas when reading the file in (instead just use the precalculated values as is) I can get

How to convert HTML chars in PHPExcel?

喜你入骨 提交于 2019-12-12 10:57:44
问题 Developing PHP application that generates Excel documents on the fly, using PHPExcel (http://phpexcel.codeplex.com/). Problem I have is that my Excel document will contain some special HTML chars, like ° , ’ , ” etc... But in generated XLS file, all I getting is ° , ’ , ” , etc, not °, ’, ”, like I need. Can you help me how to get this in XLS documents? 回答1: Remember that you should always use UTF-8 for strings in PHPExcel $str = '32°Fahrenheit = 0°Centigrade'; $str = html_entity_decode($str

PHPExcel excel read is not working for some cells with calculation

╄→гoц情女王★ 提交于 2019-12-12 10:04:26
问题 I use PHPExcel lib for read the excel file in Codeigniter project. It is not read some cells with calculation. It show as #VALUE! But some values with calculation is reading in same excel sheet. Whats wrong with those cells? Cells with have following calculation is not reading =+D109*1000 =+B16/B13 =+D23/$D$109 Cells with have following calculation is reading =+B10-B11 =+C10-C11 But all cells are reading for some excel sheet. This issue come with xlsx format This is my code $objReader =

Format The Cells For Entire Column In PHP Excel

狂风中的少年 提交于 2019-12-12 05:15:13
问题 I have used the solution found within this Answer. The code I used looks like this: $objWorksheet->getColumnDimension("AM")->setWidth(20); $objWorksheet->SetCellValue("AM1", "Date1"); $objWorksheet->getStyle("AM") ->getNumberFormat() ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT); The one problem I had is when I select the entire column as such: It still says "general". But when I select a range of columns from 0 to 4500 lets say: It shows up as "text". If set to "General" the

dd/mm/yyyy format in PHPExcel adding single quote(') in cell

别说谁变了你拦得住时间么 提交于 2019-12-12 05:07:53
问题 In my webpage, I am using PHPexcel 1.8 to generate excel files. Now I am facing an issue which describes below. I have some date values in the format dd/mm/yyyy . The value is coming. But it shows with a single quote(') at the begining. I tried many solutions. But none helps me out. My sample code portion is given below $cnt = 1; foreach($gluuidArr as $uuid){ $this -> excel_180->getActiveSheet() ->setCellValue('A'.$cnt,$aVal); $this -> excel_180->getActiveSheet() ->setCellValue('B'.$cnt,$bVal

Codeigniter / PHPexcel Set arabic title in properties of xls file

…衆ロ難τιáo~ 提交于 2019-12-12 04:09:00
问题 I am working on my web project using Codeigniter. I want to generate an excel file by setting the data in the file, for now that's cool. but I have a problem is that the site uses Arabic as a primary language, and I would set the title and description in the properties of excel file. when I open the excel file and I open the properties, it does not display the title and description in Arabic, but like this: هل تعتقد أن النظام السورÃ

PHPExcel toArray is changing date and time columns from XLSX format

我们两清 提交于 2019-12-12 04:08:51
问题 I am using the excelToArray function found here: https://gist.github.com/calvinchoy/5821235 function excelToArray($filePath, $header = true) { require_once("./PHPExcel/Classes/PHPExcel.php")); //Create excel reader after determining the file type $inputFileName = $filePath; /** Identify the type of $inputFileName **/ $inputFileType = PHPExcel_IOFactory::identify($inputFileName); /** Create a new Reader of the type that has been identified **/ $objReader = PHPExcel_IOFactory::createReader(

How to make Y-axis of bar chart and line chart stick to left side for PHPExcel?

落花浮王杯 提交于 2019-12-12 03:53:23
问题 Currently when there are negative value in data, the y-axis of bar/line chart will be moved to middle of the graph by default. Is there a way to make the y-axis stick to the leftmost of the graph in PHPExcel? 回答1: That can be done by setting the Y & X Axis styles. I don't recall which version implemented them so it may work with your current version, or grab the latest PHPExcel PHPExcel_Chart_Axis is the new object that will be created. You can read more about it here and this is an example

Export excel file using PHPExcel working in my local pc but not working in live server

我是研究僧i 提交于 2019-12-12 03:37:46
问题 I have a "Download excel file" button in my website. When I click this button, it runs download_header() function. Here is the function's code public function download_header($pid) { // get pick_list table's field name $this->load->model('Download_excel_model'); $fields = $this->Download_excel_model->table_field_name('pick_list'); // Starting the PHPExcel library $this->load->library('excel'); $objPHPExcel = new PHPExcel(); $objPHPExcel->getProperties()->setTitle("export")->setDescription(

PHPExcel number formats for dates

[亡魂溺海] 提交于 2019-12-12 03:15:18
问题 I have a spreadsheet that when i open in excel the cells in question show formatting as date mm-dd-yyyy. When I run this through php excel reader (xlsx file) it does not recognize that it is a date. I opened the file in ms open xml sdk and it shows in the styles for numFmts numFmtId="102" formatCode="mm-dd-yyyy" numFmtId="104" formatCode="mm-dd-yyyy" numFmtId="106" formatCode="mm-dd-yyyy" numFmtId="108" formatCode="mm-dd-yyyy" numFmtId="110" formatCode="mm-dd-yyyy" numFmtId="112" formatCode=