I am using phpexcel in drupal to import data from uploaded excel file by the user. I have a column with number type in excel. But its a long number. When I use phpexcel_import() I get "982000364137756" in excel as "9.8200036413776E+14" . Is there any way to resolve this issue. I does not have the option of changing data type in excel file. I have to find a way to it by script.
↧
New Post: php excel in drupal , Long numbers import issue
↧
New Post: Possible bug: typo in source code?
PHP Version 5.2.17
PHPExcel 1.8
I produced this error when I tried to output a .xlsx file with HTML rich text formatting.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /.../phpexcel/Classes/PHPExcel/Helper/HTML.php on line 591
When I took a look at Helper/HTML.php on line 591, I found this:
There is no problem with the backslash when I tested on PHP 5.5.9, since object namespaces were introduced in 5.3.0. But in 5.2 (the minimum version required for PHPExcel 1.8), this seems to be causing an error.
PHPExcel 1.8
I produced this error when I tried to output a .xlsx file with HTML rich text formatting.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /.../phpexcel/Classes/PHPExcel/Helper/HTML.php on line 591
When I took a look at Helper/HTML.php on line 591, I found this:
$dom = new \DOMDocument;
After I removed the backslash, the error was resolved.There is no problem with the backslash when I tested on PHP 5.5.9, since object namespaces were introduced in 5.3.0. But in 5.2 (the minimum version required for PHPExcel 1.8), this seems to be causing an error.
↧
↧
New Post: Excel to php or mysql
Hi,
I need value from excel to php mysql
Excel file
above is excel file
IN PHP Page I have value in drop down (static) :
1 } 0.45-0.90 ( range ) : textbox
2 } AB , XE - drop down
3 } A,B,C,D - drop down
4 } b1,b2,b3,X1,X2,X3 - drop down
when any user select above drop-down data from php page , it should take value from excel and print output in browser:
Like : example as below : when any one select :
0.45 - AB - A - b1 : then he will get output in textbox as 23
0.45 - AB - A - b2 : then he will get output in textbox as 34
0.55 - AB - A - b2 : then he will get output in textbox as 34
0.69 - AB - B - b2 : then he will get output in textbox as 31
0.69 - XE - B - X2 : then he will get output in textbox as 23
0.90 - XE - C - X3 : then he will get output in textbox as 23
0.90 - XE - D - X1 : then he will get output in textbox as 56
Need help how i can do same ..as its something new for me
I need value from excel to php mysql
Excel file
above is excel file
IN PHP Page I have value in drop down (static) :
1 } 0.45-0.90 ( range ) : textbox
2 } AB , XE - drop down
3 } A,B,C,D - drop down
4 } b1,b2,b3,X1,X2,X3 - drop down
when any user select above drop-down data from php page , it should take value from excel and print output in browser:
Like : example as below : when any one select :
0.45 - AB - A - b1 : then he will get output in textbox as 23
0.45 - AB - A - b2 : then he will get output in textbox as 34
0.55 - AB - A - b2 : then he will get output in textbox as 34
0.69 - AB - B - b2 : then he will get output in textbox as 31
0.69 - XE - B - X2 : then he will get output in textbox as 23
0.90 - XE - C - X3 : then he will get output in textbox as 23
0.90 - XE - D - X1 : then he will get output in textbox as 56
Need help how i can do same ..as its something new for me
↧
New Post: Help me with bubblechart
I PHPExcel managing the library in the examples of graphs and referring to the manual , I have a problem with the following string TYPE_BUBBLECHART the project by including the generated file error mark 've tried with this structure:
$ Series = new PHPExcel_Chart_DataSeries (
PHPExcel_Chart_DataSeries :: TYPE_BUBBLECHART , // plotType
NULL, // plotGrouping ( Scatter charts do not Have any grouping )
range ( 0 , count ( $ dataSeriesValues ) -1) // plotOrder
dataseriesLabels , // $ plotLabel
$ XAxisTickValues , // plotCategory
$ DataSeriesValues , // plotValues
NULL, // smooth line
NULL // plotStyle
) ;
and I still marks the error when generating the file, also mentioned that in previous inside the folder , the same way to generate brand 32readwriteBubbleChart1.xls examples mistake , I hope I aglo I can support this issue.
$ Series = new PHPExcel_Chart_DataSeries (
PHPExcel_Chart_DataSeries :: TYPE_BUBBLECHART , // plotType
NULL, // plotGrouping ( Scatter charts do not Have any grouping )
range ( 0 , count ( $ dataSeriesValues ) -1) // plotOrder
dataseriesLabels , // $ plotLabel
$ XAxisTickValues , // plotCategory
$ DataSeriesValues , // plotValues
NULL, // smooth line
NULL // plotStyle
) ;
and I still marks the error when generating the file, also mentioned that in previous inside the folder , the same way to generate brand 32readwriteBubbleChart1.xls examples mistake , I hope I aglo I can support this issue.
↧
New Post: Trouble with masks while exporting XlXS to HTML
Hello,
I´m trying to use the PHPExcel to convert Excel Files to HTML, the Excel file have some masks (like number format, currency, dates, etc.) but when i try to export it to HTML, it show the field without his mask.
EX:
Here is my Code:
I´m trying to use the PHPExcel to convert Excel Files to HTML, the Excel file have some masks (like number format, currency, dates, etc.) but when i try to export it to HTML, it show the field without his mask.
EX:
in MS Excel the column show the date in Brazil format: "21/02/2016"
in HTML the column show the date without mask: "2016-02-12"
There's any way to convert to HTML with the masks?Here is my Code:
$excelReader = new PHPExcel_Reader_Excel2007();
//Lê o arquivo excel
$excelFile = $excelReader->load($file_location);
//Converte o arquivo para HTML
$excelWriterHtml = new PHPExcel_Writer_HTML($excelFile);
//Pega os dados HTML
$excelHtml = $excelWriterHtml->generateHTMLHeader();
$excelHtml .= '<style>' . utf8_decode($excelWriterHtml->generateStyles()) . '</style>';
$excelHtml .= $excelWriterHtml->generateSheetData();
$excelHtml .= $excelWriterHtml->generateHTMLFooter();
//echo or download the file after this code
↧
↧
New Post: Worksheet Tab color
Hi friends,
I am using phpexcel library to import excel files. When I acquire the Phpexcel object after loading the file, I loop around all the sheets to read their data. I need to know the tab color of the worksheets to branch my code so I am using Worksheet->getTabColor() function to access it but it is returning null. It seems that the worksheet tab color is getting read by the library.
My code is like this:-
I am using phpexcel library to import excel files. When I acquire the Phpexcel object after loading the file, I loop around all the sheets to read their data. I need to know the tab color of the worksheets to branch my code so I am using Worksheet->getTabColor() function to access it but it is returning null. It seems that the worksheet tab color is getting read by the library.
My code is like this:-
$excelReader = PHPExcel_IOFactory::createReader($writer);
$excelReader->setReadDataOnly(FALSE);
$excelReader->setLoadAllSheets(TRUE);
$excelObj = $excelReader->load($file);
$worksheetNames = $excelObj->getSheetNames($file);
foreach ($worksheetNames as $sheetName) {
var_dump($excelObj->getSheetByName($sheetName)->getTabColor());
}
Every time it is returning printing null. Please help somebody.↧
New Post: Phpexcel chart showing by previous chart data
I need to show two chart with different data.
first chart by project data example :
problem chart attached here:
![Image]()
first chart by project data example :
$objWorksheet->fromArray(
array(array('projects','p1', 'p2', 'p3', 'p4', 'p5'),
array('',10,15,25,35,45)
)
);
Second chart by weekly data example:$objWorksheet->fromArray(
array(
array('', 'sun',),
array('Mon', $mon),
array('Tue', $tue),
array('Wed', $wed),
array('Thu', $thu),
array('Fri', $fri),
)
);
problem is , chart 1 (with first project) generated , it generated with values form chart 2(with weekly data). how to fix this, problem? so chart1 (project) only show project data/value , not from weekly data?problem chart attached here:

↧
New Post: Charts/graphs in PDFs - changing size, position, ticks?
I'm successfully writing bar charts in Excel files and outputting them as PDF. However, when shown in PDFs, the chart is rendered poorly meaning:
Thanks,
Mat
- yaxis ticks are cut off when too long (more than about 5 characters)
- xaxis ticks overlap each other
- axis labels overlap ticks
-
graph could benefit from more padding or different position in the cell
Thanks,
Mat
↧
New Post: Creating a Slicer using PHPExcel
Hi,
I have searched unsuccessfully to see if there is a way to utilize the Excel Slicer functionality with PHPExcel. I have not found any options for this. Is this correct? I've even tried creating a Slicer (and required, inserted table) within a template and used the template file to create my file with PHPExcel, but that just removes the Slicer because the file written out is first a php file then rewritten to be an Excel file.
Are there any options to make this work?
I'm on PHP 5.6 and Excel 2016. Latest version of PHP Excel as of this date.
Thanks!!
I have searched unsuccessfully to see if there is a way to utilize the Excel Slicer functionality with PHPExcel. I have not found any options for this. Is this correct? I've even tried creating a Slicer (and required, inserted table) within a template and used the template file to create my file with PHPExcel, but that just removes the Slicer because the file written out is first a php file then rewritten to be an Excel file.
Are there any options to make this work?
I'm on PHP 5.6 and Excel 2016. Latest version of PHP Excel as of this date.
Thanks!!
↧
↧
New Post: Repeating column headers by group
I have my query result grouped by categories, and when the category changes I want to display the column headers again, in html works fine but I can't make it work with PHPExcel, can this be done?
I'm a little confussed...
Thanks...
I'm a little confussed...
Thanks...
↧
New Post: How to get value from cell with formats preserved
I am working on Excel to Word conversion. Some of the text in the excel cell may have formats (bold, underline , superscript, etc., ) and they are not retrieved exactly as it is using getValue() or getFormattedValue() method in PHP. They are just retrieved as a plain text. How to get the text from cell with formats preserved
Any help would be grateful.!
Thanks in advance.
Any help would be grateful.!
Thanks in advance.
↧
New Post: How to set column value contain non-ascii
Hy, i am new in using phpexcel.
currently my system using mass upload data to the database, and mostly the data is copy and paste in to excel. File type mass upload is comma separated value. so their is high possible contain of non ascii value inside the column.
So i am using phpexcel to generate the data fail insert into database.
but the problem is that, some of the data column contain false because the data contain non ascii,
so how to set the column value same as what i upload file.!
this is the file i upload
![Image]()
this is error data
![Image]()
from the image we can see that "Address" column contain value is False. i want that column contain value same as what i upload instead of FALSE.
currently my system using mass upload data to the database, and mostly the data is copy and paste in to excel. File type mass upload is comma separated value. so their is high possible contain of non ascii value inside the column.
So i am using phpexcel to generate the data fail insert into database.
but the problem is that, some of the data column contain false because the data contain non ascii,
so how to set the column value same as what i upload file.!
this is the file i upload
this is error data
from the image we can see that "Address" column contain value is False. i want that column contain value same as what i upload instead of FALSE.
↧
New Post: How to set column value contain non-ascii
If you know what charset the csv file is using, then tell the PHPExcel Reader that using the Reader's
setInputEncoding()
method before calling the load(); otherwise PHPExcel assumes that it's UTF-8↧
↧
New Post: How to set column value contain non-ascii
$filename = date('H-i-s')."_fail_sp";
/** Error reporting */
error_reporting(E_ALL);
/** Include path **/
ini_set('include_path', ini_get('include_path').';../Classes/');
/** PHPExcel */
include 'library/PHPExcel/Classes/PHPExcel.php';
/** PHPExcel_Writer_Excel2007 */
include 'library/PHPExcel/Classes/PHPExcel/Writer/Excel2007.php';
// Create new PHPExcel object
$objPHPExcel = new PHPExcel();
// Set properties
$objPHPExcel->getProperties()->setCreator("LookP Team");
$objPHPExcel->getProperties()->setLastModifiedBy("LookP Team");
$objPHPExcel->getProperties()->setTitle("Office 2007 XLSX Mass Upload Fail SP download");
$objPHPExcel->getProperties()->setSubject("Office 2007 XLSX Test Document");
$objPHPExcel->getProperties()->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.");
$worksheet = $objPHPExcel->getActiveSheet();
foreach($error_businessInfo as $row => $columns) {
foreach($columns as $column => $data) {
$worksheet->setCellValueByColumnAndRow($column, $row + 1, $data);
}
}
// Rename sheet
$objPHPExcel->getActiveSheet()->setTitle('Simple');
// Save Excel 2007 file
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save("download/$filename.xlsx");
this is my code section, i am not sure where should i put the "setinputencoding". the file i upload is type "Windows-1252" and i wanna produce file "Windows-1252"↧
New Post: Help! Do not correct / not read xlsx file! What is the problem?
Do not correct / not read xlsx file! What is the problem?
2.xlsx
The only problem with this file.
MSWord opens ok.
Calc only partially.
Phpexel only partially.
2.xlsx
The only problem with this file.
MSWord opens ok.
Calc only partially.
Phpexel only partially.
↧
New Post: How to make it work PHPExcel with php 7?
Hello
How to make it work PHPExcel with php 7?, you can do something in the code? or you have to wait the next version of PHPExcel?
Thanks for your help.
How to make it work PHPExcel with php 7?, you can do something in the code? or you have to wait the next version of PHPExcel?
Thanks for your help.
↧
New Post: Cann't save excel 2007 document with PHPExcel 1.8.0 at the combat host
Hello!
By means of PHPExcel 1.8.0 I've developed the php code, which generates an excel file. This code works well at the localhost server but at the combat host it doesn't work. As I found out the reason is in this one line of code:
Please help me to understand the reason why do the excel 2007 document cann't be created at the combat host.
By means of PHPExcel 1.8.0 I've developed the php code, which generates an excel file. This code works well at the localhost server but at the combat host it doesn't work. As I found out the reason is in this one line of code:
$writer = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
If I change 'Excel2007' with 'Excel5' everything works. Some men tells that the reason is in the host settings. I'm using the selfmanaged VPS. Please help me to understand the reason why do the excel 2007 document cann't be created at the combat host.
↧
↧
New Post: UPDATE EN PHPEXCEL
good day, I want to know if I can use a then updated, rather than an insert to import data from Excel to a mysql table. it's possible? I try to feed a table and existento with a difference between some fields
Thank you for your attention
Thank you for your attention
↧
New Post: Cloning the calculation engine is not allowed!
I've created my first project with PHPExcel. Everything works fine local, but when I upload to server I've got this error:
Fatal error: Uncaught exception 'PHPExcel_Calculation_Exception' with message 'Cloning the calculation engine is not allowed!' in /usr/extacy_giuliano/gerp/libs/phpexcel/PHPExcel/Calculation.php:2157
File are the same but on remote server doesn't work !
Thanks in advance.
Fatal error: Uncaught exception 'PHPExcel_Calculation_Exception' with message 'Cloning the calculation engine is not allowed!' in /usr/extacy_giuliano/gerp/libs/phpexcel/PHPExcel/Calculation.php:2157
File are the same but on remote server doesn't work !
Thanks in advance.
↧
New Post: text in excel cell are cut :(
$sheet->setCellValueByColumnAndRow(6,$ligne,$data['description']);
echo $sheet->getCellByColumnAndRow(6,$ligne)->getValue();
We put $data['description'] which is long text in column 6 ligne 1 for exampleText is reduced to 40 caracters when we do the echo and in the excel file same problem the text is reduce too
Do you have any idea ?
↧