ARCHIVED

Related tags

Office PHPExcel
Overview

PHPExcel - DEAD

PHPExcel last version, 1.8.1, was released in 2015. The project was officially deprecated in 2017 and permanently archived in 2019.

The project has not be maintained for years and must not be used anymore. All users must migrate to its direct successor PhpSpreadsheet, or another alternative.

License

PHPExcel is licensed under LGPL (GNU LESSER GENERAL PUBLIC LICENSE)

Comments
  • PHPExcel not working with PHP 7.0

    PHPExcel not working with PHP 7.0

    Hi. Is possible fix PHPExcel for working with PHP 7.0?

    In actual version is error:

    Fatal error: 'break' not in the 'loop' or 'switch' context in <mypath>\PHPExcel\PHPExcel\Calculation\Functions.php on line 581
    

    Please fix this. Thank you.

    opened by Ajtak 31
  • reading xlsx file creates HTML reader?

    reading xlsx file creates HTML reader?

    $name = 'test.xlsx';
    
    $excel       = \PHPExcel_IOFactory::load($name);
    $sheetData   = $excel->getActiveSheet()->toArray(NULL, FALSE, FALSE, TRUE);
    

    and i get this error DOMDocument::loadHTMLFile(): Invalid char in CDATA 0x3 in file:///C:/Windows/TEMP/54366714e6daetest%20importu%20poloziek.xlsx, line: 1

    wtf? phpexcel idenitfies the format as excel2007 why does it load html reader then? and why should excel load html files? what kind of bullshit is that?

    opened by bazo 26
  • Row auto height broken in Libre Office?

    Row auto height broken in Libre Office?

    I tried to auto a row/cell with PHPExcel. It works awesome when I open the document with Excel itself, but it does not work with Libre Office.

    I tried $sheet->getRowDimension($row_no)->setRowHeight(-1); and $sheet->getDefaultRowDimension()->setRowHeight(-1);. It does not work.

    I found this old bug report here: https://phpexcel.codeplex.com/discussions/429322

    Unfortunately the provided solution does not work.

    Any ideas on this topic?

    opened by firegate666 21
  • Support of Namespaces

    Support of Namespaces

    Hello :-),

    PHPExcel requires PHP 5.2 as the lowest PHP version needed to run. PHP 5.3 is reaching its EOL (this month). It's why I propose to use PHP 5.4 as the new lowest required PHP version.

    I understand that some users are still using PHP 5.3 and won't be able to migrate as soon as possible. It's why I open this issue for discussing

    Pros of using PHP 5.4 :

    • some tricky code will be dropped (and we are talking about several hundreds of LOC),
    • (consequentely) code will be easier to maintain,
    • global performances.

    Cons of using PHP 5.4 :

    • some users are not using 5.4, even if they must (because 5.3/5.2 will be definitively dead).

    Poke @PHPOffice/phpexcel-team / @MarkBaker

    Type - Question 
    opened by Progi1984 20
  • Problems when using PHP native round() function

    Problems when using PHP native round() function

    I know this is weird but... isolating this code:

    require_once dirname(__FILE__) . '/lib/PHPExcel/IOFactory.php';
    echo round(68.3499,2).PHP_EOL; // Works
    $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
    echo $inputFileType.PHP_EOL; // Just to get the file type
    echo round(68.3499,2).PHP_EOL; // Works
    $objReader = PHPExcel_IOFactory::createReader($inputFileType);
    echo round(68.3499,2).PHP_EOL; // Works
    $objPHPExcel = $objReader->load($inputFileName);
    echo round(68.3499,2).PHP_EOL; // KA-BOM, right after the load() call
    

    I get this result:

    68.35
    Excel5
    68.35
    68.35
    68.34999999999999
    

    Problem starts just after loading the file with the Reader object... PHP 5.3.5-1ubuntu7.11 any idea on what's happening here ? Thanks in advance !

    Type - Bug 
    opened by MarcosBL 20
  • Fatal Error (running out of memory) on writing more than 4000 rows approx

    Fatal Error (running out of memory) on writing more than 4000 rows approx

    Hello.

    I am trying to solve this since 2 days. Also read many threads on stackoverflow. I am trying to write an Excel/CSV file.

    My code works fine except when rows exceed somewhere around 4000, with 15 columns, it throws a fatal error saying the memory limit has exhausted. I increased my memory limit in php.ini at 512MB, but no help! Whatever amount of memory I give, it gets exhausted after this limit. I am reading data from text file of around 700 kb. If anyone faced similar thing, please help!

    opened by shreygokani 18
  • Clean old & unuseful files

    Clean old & unuseful files

    Some old files created by @maartenba could be deleted. No ?

    phpdoc-home.ini 
    phpdoc.ini
    setpath.bat
    start_shell.bat
    Documentation/assets/*
    Build/old/*
    

    A file is duplicate

    Diff between README.md and readme.md
    

    And others which contains samples and tests for JAMA

    Classes/PHPExcel/Shared/JAMA/examples
    Classes/PHPExcel/Shared/JAMA/tests
    
    Type - Question 
    opened by Progi1984 16
  • Undefined variable: options in PHPExcel/Settings.php on line 384

    Undefined variable: options in PHPExcel/Settings.php on line 384

    I am receiving this error message: PHP Notice: Undefined variable: options in /path/to/my/project/vendor/phpoffice/phpexcel/Classes/PHPExcel/Settings.php on line 384

    It seems it has been fixed in the develop branch, but it is not merged to the last stable tag - 1.8.0.

    Can you advise on how to get the fix?

    Type - Bug 
    opened by dinamic 15
  • After upgrading to PHP 5.6.29, using SQLite3 cache method does not generate records in excel file

    After upgrading to PHP 5.6.29, using SQLite3 cache method does not generate records in excel file

    After upgrading to PHP 5.6.29 in my server (from 5.6.28 using the dotdeb repository), PHPExcel generates empty Excel files when using SQLite3 cache method. If I disable the caching method, it works, the Excel file is as expected.

    Type - Bug 
    opened by lourdas 14
  • add a basic composer configuration file

    add a basic composer configuration file

    see PHPOffice/PHPExcel#51

    to test installation with composer:

    add this to your composer.json config file

    {
        "repositories": [
            {
                "type": "vcs",
                "url": "https://github.com/csanquer/PHPExcel.git"
            }
        ],
        "minimum-stability": "dev",
        "require": {
            "phpoffice/phpexcel": "*"
        }
    }
    

    then run

    php composer.phar update
    

    A class mapping is generated in vendor/composer/autoload_classmap.php and you need only to include the autoloader vendor/autoload.php

    Type - Enhancement 
    opened by csanquer 14
  • CSV Dates Written Differently Depending on Reader File Format

    CSV Dates Written Differently Depending on Reader File Format

    I've created a very simple php script which reads in either an XLSX or XLS file, and then exports the file content to CSV. Here's the guts of the program, which you've seen many times before:

    $objReader = PHPExcel_IOFactory::createReader($cExcelFileType);
    $objSpreadsheet = $objReader->load($cExcelFileName);
    $objWriter = PHPExcel_IOFactory::createWriter($objSpreadsheet, "CSV");
    $objWriter->save($cCsvFileName);
    

    What's interesting is that if I read in an XLS file and then output a CSV, dates are written in dd/mm/yyyy format as expected. However, if I read in an XLSX file and output a CSV, the dates are written out as integers. I would have expected the CSV file to be written out using date strings regardless of the import format.

    opened by ComputerTinker 13
  • read csv with long number data get scientific notation

    read csv with long number data get scientific notation

    Hi, I have a CSV with one column to read with this data:

    SerialNumber 8954310143063931904 8954310143063931938 8954310143063931920 8954310143063931912 8954310143063931896 8954310143063931516 8954310143063931540

    I am doing: $inputFileType='Csv'; $objReader=IOFactory::createReader($inputFileType); $objWorksheet = $objPHPExcel->getActiveSheet(); $cell=$objWorksheet->getCellByColumnAndRow($col,$fila);

    And $cell gets cientific notation like 8.9543101430639E+18 instead of 8954310143063931904 How can solve this problem and get de values as strings? Thanks

    opened by dpbuzz 0
  • Set document properties with UTF-8 Encoding (for accents)

    Set document properties with UTF-8 Encoding (for accents)

    e.g. when $objPHPExcel->setTitle("Reporte de Categorías"), in the exported file the property is stored as "Reporte de Categorías". The same thing happens with setDescription(), setLastModifiedBy() and similar methods. No problem occurs when storing utf8 chars in the cells, the only issue is for file properties.

    PHPExcel version: 1.8 PHP version: 7.2.4

    opened by csrnontol 0
  • PHP Excel 1.8.2 Loss of precision when writing numeric strings

    PHP Excel 1.8.2 Loss of precision when writing numeric strings

    | Q | A | ----------------- | --- | Package version | 1.8.2 | PHP version | 7.1.16

    Actual Behaviour

    When I used PHP Excel to write a large numeric string, I found that the behaviors of 1.8.1 and 1.8.2 were inconsistent. My code is as follows:

    $objPHPExcel = new \PHPExcel();
            // Set document properties
            $objPHPExcel->getProperties()
                ->setCreator("REPORTINFO")
                ->setLastModifiedBy("VeryStar")
                ->setTitle("VeryStar REPORTINFO")
                ->setSubject("VeryStar REPORTINFO")
                ->setDescription("VeryStar REPORTINFO")
                ->setKeywords("VeryStar")
                ->setCategory("VeryStar");
            $sheet_num = 1;
    
            $phpExcelActiveSheet = $objPHPExcel->getActiveSheet();
            $objPHPExcel->setActiveSheetIndex(0)->setTitle('demo');
            $objPHPExcel->getActiveSheet()->getStyle('E')->getNumberFormat()->setFormatCode(\PHPExcel_Style_NumberFormat::FORMAT_NUMBER);
            $objPHPExcel->getActiveSheet()->getStyle('G')->getNumberFormat()->setFormatCode(\PHPExcel_Style_NumberFormat::FORMAT_NUMBER);
            $phpExcelActiveSheet->setCellValue('A' . $sheet_num, 'PHP Version');
            $phpExcelActiveSheet->setCellValue('B' . $sheet_num, 'System');
            $phpExcelActiveSheet->setCellValue('C' . $sheet_num, 'Excel Version');
            $phpExcelActiveSheet->setCellValue('D' . $sheet_num, 'test value 1');
            $phpExcelActiveSheet->setCellValue('E' . $sheet_num, 'test value 2');
            $phpExcelActiveSheet->setCellValue('F' . $sheet_num, 'test value 3');
            $phpExcelActiveSheet->setCellValue('G' . $sheet_num, 'test value 4');
    
            $sheet_num++;
            $phpExcelActiveSheet->setCellValue('A' . $sheet_num, PHP_VERSION);
            $phpExcelActiveSheet->setCellValue('B' . $sheet_num, PHP_OS);
            $phpExcelActiveSheet->setCellValue('C' . $sheet_num, '1.8.2');
            $phpExcelActiveSheet->setCellValue('D' . $sheet_num, '898350553311499'."\t");
            $phpExcelActiveSheet->setCellValue('E' . $sheet_num, '898350553311499');
            $phpExcelActiveSheet->setCellValue('F' . $sheet_num, '898350553311491'."\t");
            $phpExcelActiveSheet->setCellValue('G' . $sheet_num, '898350553311491');
            $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
            $file_name = '/data/demo-1.8.2.xlsx';
            $objWriter->save($file_name);
    

    1.8.2 Write is the following data: demo-1.8.2.xlsx 1 8 2

    The number is found to be rounded up according to the mantissa But 1.8.1 does not have this problem: demo-1.8.1.xlsx 1 8 1

    opened by myloveGy 0
  • PHPExcel_Worksheet_Drawing

    PHPExcel_Worksheet_Drawing

    Hello, I am using this library for an application. I have a problem with the images and the library seems is not working well. I am using Excel 2016 When filtering columns, the images for the hidden columns still showing.

    Look at the attached pictures. Is there a way to solve this?

    1 2

    opened by jlnmay 0
Owner
PHPOffice
PHPOffice