phpexcel

PHPExcel to insert database using Pg_query

大憨熊 提交于 2019-12-13 07:03:51
问题 I'm using PHP Excel to insert data CSV into database. But i confused to apply it. Here's Mycode: <?php session_start(); include 'connect.php'; include 'PHPExcel/Classes/PHPExcel/IOFactory.php'; $input=$_POST['times']; $rev=$_POST['rev']; $chan=$_POST['channel']; $uploadid='UP'.$_POST['number']; $fcid = 'FC'.$_POST['number']; $schid = 'SCH'.$_POST['number']; $file = $_POST['filename']; $inputFileName = 'D:/ForecastCapacity/'.$file; echo($input.'/'.$rev.'/'.$chan.'/'.$uploadid.'/'.$file); //

Create multi color bar in PHPExcel Charts

99封情书 提交于 2019-12-13 05:07:44
问题 I want to create a bar chart using PHPExcel in multi color means every bar can contain multi color as shown below. I have searched it out but couldn't be able to find out the solution. Second question how can I increase width of bar? Best Regards 回答1: It's a stacked column chart, so you need to set the plotGrouping to PHPExcel_Chart_DataSeries::GROUPING_STACKED See /Examples/33chartcreate-bar-stacked.php for an example but set $series->setPlotDirection(PHPExcel_Chart_DataSeries::DIRECTION

PHPExcel outputs garbled text

ⅰ亾dé卋堺 提交于 2019-12-13 04:52:03
问题 Like many others out there i have had my fair share of issues trying to download an Excel file output by PHPExcel. What happened in my case was whenever I wanted to download a file using $obj->save('php://output') i always used to get garbled text in my excel file with a warning saying my file was corrupt. Eventually i resolved the issue. The problem being i had a require('dbcon.php') at the top of my php script. I just replaced that with whatever was there inside dbcon.php and it worked fine

PHPExcel plugin does not import file in cakephp

我的梦境 提交于 2019-12-13 04:43:11
问题 I m trying to import 2010 xlsx file to mysql db in CAKEPHP. PHPExcel plugin is used for excel operations. I m facing below issues. Issue 1 :: I see below error when my view is launched Notice (8): Undefined index: Program [APP\Controller\ProgramsController.php, line 83] Issue 2 :: On browsing xlsx file from view and when submit button is clicked i see below error. Could not open import.xlsx for reading! File does not exist. Error: An Internal Error Has Occurred. Stack Trace APP\Vendor

PHPExcel Load Files More Than 15 seconds

一曲冷凌霜 提交于 2019-12-13 03:54:03
问题 I'm using PHPExcel version 1.7.9. Here is my PHP code : $temp_name = $_FILES['upload']['tmp_name']; $fname = $_FILES['upload']['name']; $transfer = move_uploaded_file($temp_name,TEMP_DIR.$fname); $file_location = TEMP_DIR.$fname; $inputFileType = PHPExcel_IOFactory::identify($file_location); $objReader = PHPExcel_IOFactory::createReader($inputFileType); $objReader->setReadDataOnly(true); $objPHPExcel = $objReader->load($file_location); for each line of code above I echo time taken to produce

PHPExcel converts dot after writing in comma

被刻印的时光 ゝ 提交于 2019-12-13 02:51:53
问题 I generate an Excel file with importing a csv file. In CSV has contents with following numbers 4.0238484 5.3833888 dot seperated But if I write an Excel file than the column show me the numbers in following format 4,0238484 5,3833888 I want the dot instead of comma. How can I make it? PHPExcel Version 1.7.7 回答1: Check the locale settings for the version of MS Excel that you are using to view the generated file: if it's set to a locale that uses a decimal comma rather than a decimal point,

How to generate a nice PDF with php Excel?

最后都变了- 提交于 2019-12-12 20:35:20
问题 I'm using the last PHPExcel version (7.7 i think). I'm able to generate my excel. I have to generate the pdf version with tcpdf, no choice here. But the result is ugly and oversized. See the gigantic font-size for 2012-000012, is 11 in excel. As you can see, there is 2 problems here. The document is oversized, and the borders are crappy. In order to get rid of the oversized side, i tryied this : $this->printer->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup:

PHPExcel file could be corrupted or unsafe

你说的曾经没有我的故事 提交于 2019-12-12 20:16:18
问题 When I generate an Excel report using PHPExcel I get this error: "The file format and extension of 'test.xls' don't match. The file could be corrupted or unsafe. Unless you trust its source, don't open it. Do you want to open it anyway?" This is my set up -- PHP 5.4/PHPExcel 1.7.9/Windows 7 When I click 'OK' to open the unsafe excel file anyway it either is empty or gibberish. HTML Code: it allows the the user to select a report from the drop down then they select the button if they either

PHPExcel date required dd/MM/yy

不羁岁月 提交于 2019-12-12 17:08:04
问题 I am using PHPExcel Lib to download excel sheet and have required the column date format like 25-May-17 instead of 25-05-17 in my download excel sheet. I was able to added number format 25-05-17 but not like 25-May-17 and below is my code like. $objPHPExcel->getActiveSheet() ->getStyle('V'.$i) ->getNumberFormat() ->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY ); I can not find the constant in Lib class const FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd'; const FORMAT_DATE_YYYYMMDD

Unlock All cells on PHPExcel

会有一股神秘感。 提交于 2019-12-12 14:56:35
问题 SOLVED!! Found myself correct way to solve this problem . Use like PHPExcel::getDefaultStyle()->getProtection()->setLocked(fals‌​e); It's awesome :) First of all, excel's default cell protection setting is (lock & visible). I want to use lock some rows and unlock remaining rows. I found ways to unlock specific cell and I try apply that to unlock all cells by some iterator. But select all cells job is too heavy to execute iterator. Is there something to change cell's default protect setting