Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:12
    MarkBaker commented #3341
  • 15:36
    oleibman commented #3341
  • 15:25

    oleibman on master

    Allow More Fonts/Fontnames for … (compare)

  • 15:25
    oleibman closed #3190
  • 15:25
    oleibman closed #3326
  • 15:10
    oleibman synchronize #3326
  • 14:12
    MarkBaker commented #3341
  • 12:33

    MarkBaker on Format-Masks_Improved-@

    (compare)

  • 12:33

    MarkBaker on master

    Improved handling of @ format m… (compare)

  • 12:22

    MarkBaker on master

    Improved handling of @ format m… Merge pull request #3344 from P… (compare)

  • 12:22
    MarkBaker closed #3344
  • 11:54
    MarkBaker synchronize #3344
  • 11:54

    MarkBaker on Format-Masks_Improved-@

    Improved handling of @ format m… (compare)

  • 11:13
    smartyii starred PHPOffice/PhpSpreadsheet
  • 10:03
    MarkBaker closed #3346
  • 10:03
    MarkBaker locked #3346
  • 08:48
    ConnectGrid commented #3341
  • 08:25
    ConnectGrid synchronize #3347
  • 08:21
    ConnectGrid opened #3347
lalilalai
@lalilalai
Hello, I newer in licenses and I want to know, can I use PHPOffice/PhpSpreadsheet in my MIT PHP project? Thank you in advance
Adrien Crivelli
@PowerKiKi
lalilalai
@lalilalai
@PowerKiKi Thanks a lot
Marefandho
@marefandho
hai, can someone help ? about using it
I've got Class 'PhpOffice\PhpSpreadshasdeet\Spreadsheet' not found
install it using composer and trying the simple script as it told on online docs

<?php

require 'vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;

$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Hello World !');

$writer = new Xlsx($spreadsheet);
$writer->save('hello world.xlsx');

Marefandho
@marefandho
ah finally got the answer, if someone having the same problem like me
use \PhpOffice\PhpSpreadsheet\Spreadsheet;
use \PhpOffice\PhpSpreadsheet\Writer\Xlsx;
ade more backslash before PhpOffice
dabrjn
@dabrjn
composer installation of phpshreadsheet failing on linux2 box with php7.3.

Error is :
[InvalidArgumentException]
Package phpoffice/phpspreadsheet at version has a PHP requirement incompat ible with your PHP version (5.4.16)

Any idea how to fix?

Adrien Crivelli
@PowerKiKi

incompatible with your PHP version (5.4.16)

=> upgrade your PHP Version
@dabrjn

dabrjn
@dabrjn
Never could fix linux2 box php so I created a ubuntu box. All files created using phpspreadsheet cannot open in Excel. Error message is "Excel cannot open the file 'filename.Xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file." Is phpspreadsheet compatible with php 7.3?
dabrjn
@dabrjn
Continuation of above im: Files created using phpspreadsheet on my mac (php7.1.23) and also on a aws linux server (php5.6) work just fine. I did a comparison on loaded/enabled php modules between mac and ubuntu and the following ones are not on the ubuntu box, but are on the mac: bcmath, bz2, dba, ldap, pdo_pgsql, pdo-sqllite, and pgsql. Could one of these missing be an issue? I'm not using pdo, but do use mysqli calls, but even the simplest spreadsheet fails with same message. All that simple spreadsheet did was put some text in several cells.
dabrjn
@dabrjn
Continuations of above im: Problem solved. Had to issue ob_end_clean() immediately prior to $writer->save('php://output'); Why this is required on ubuntu box with php7.3 and not the other machines is puzzling, but problem is solved.
Tolga Ozses
@kartagis
hello
Tolga Ozses
@kartagis
is there a way to write to xlsx without specifying getCell()? dynamically I mean.
Adrien Crivelli
@PowerKiKi
@kartagis not sure to understand what you need, but maybe have a look at \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::fromArray()
Tolga Ozses
@kartagis
@PowerKiKi that might work for my use case. I would first read from the PDF and stuff that into an array, then use fromArray()
Yiğit
@yigitnerukuc_twitter
@PowerKiKi I sent a pull request about Calculation/SWITCH statement, when will be reviewed? PHPOffice/PhpSpreadsheet#983
Adrien Crivelli
@PowerKiKi
@isleshocky77 the v1.7.0 you were waiting for just got released: https://github.com/PHPOffice/PhpSpreadsheet/releases/tag/1.7.0
Fräntz Miccoli
@frantzmiccoli
@PowerKiKi I saw you closed PHPOffice/PhpSpreadsheet#873 could I get a few explanations for my understanding? Thanks
Stephen Ostrow
@isleshocky77
@PowerKiKi Thank you. I saw that come through a github notification.
Neal Anders
@nanderoo
Hello, I hope this is the right place to ask... I'm using PhpSpreadsheet (1.6.0) and encountering performance issues when dealing with large row / column counts and calling $writer->save(). For a 50k row / 26 column test file it takes ~3 1/2 minutes (at 100% cpu) with about 1 minute 20 seconds spent in the garbageCollect() routine.. and about a minute in the for-loop to add worksheets. The spreadsheet itself is nothing special, just text (the row number and column letter) in each cell. Is it necessary to call garbageCollect() on a new file with a very structured row/column cell build-out?
Another performance-related question / thought... in the case of larger xlsx files, would it not be more performant to write all the underlying content (xml files w/ data) out to the file/folder structure on disk, and then simply call zip to roll the folders and files into the xlsx file at the very end?
Here is some example code I'm using to test:
<?php
include_once 'include/bootstrap.php'; // Adjust bootstrap to your environment.
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
print "[".date("Y-m-d H:i:s",time())."] Start Data Population.\n";
$spreadsheet = new Spreadsheet();
$spreadsheet->setActiveSheetIndex(0);
$columnLookup = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // Limit to 26 columns
//$numberOfRows = 2500; // Takes Seconds
//$numberOfRows = 25000; // Take Minutes
$numberOfRows = 50000; // Take Minutes
//$numberOfRows = 250000; // Takes Hours
for ($row = 1; $row <= $numberOfRows; $row++) {
    for ($column = 1; $column <= 26; $column++) {
        $columnChar = substr($columnLookup, ($column -1),  1);
        $spreadsheet->getActiveSheet()
                    ->getCell("{$columnChar}{$row}")
                    ->setValueExplicit(
                        "{$columnChar}{$row}",
                        \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING
                    );
    }
    if ($row % 1000 == 0) print "."; // show progress once in awhile..
}
print "\n";
print "[".date("Y-m-d H:i:s",time())."] End Data Population.\n";
print "[".date("Y-m-d H:i:s",time())."] Start File Creation.\n";
$writer = new Xlsx($spreadsheet);
$writer->setPreCalculateFormulas(false); // Has no affect given the spreadsheet has no formulas!
$writer->save('/tmp/xlsxExample.xlsx'); // This takes --forever--  ..but why?
print "[".date("Y-m-d H:i:s",time())."] End File Creation.\n";
sgfgdf
@sgfgdf_twitter
Hello, guys! I'm reading an .xls file, which is formatted as HTML plain text. When I read the file using the \PhpOffice\PhpSpreadsheet\Reader\Html reader and then save the file as "Microsoft Excel 97-2003 (.xls)" format and use the \PhpOffice\PhpSpreadsheet\Reader\Xls the rows in the array from the worksheet are different. Is there any reason for this?
Adrien Crivelli
@PowerKiKi
@frantzmiccoli your PR has been merged manually in PHPOffice/PhpSpreadsheet@9a208b3. This is something that I often do when a few minor ajustements are necessary. Instead of wasting time asking the PR author I make the edits myself, rebase/merge/squash and push manually. This has the unfortunate effect that GitHub is not aware that the PR has actually been merged (see isaacs/github#2). But don't be mistaken, PRs, and yours in particular, are very much appreciated, even though we may not answer as fast as we would like to.
briancstevens
@briancstevens

Hello! Wasn't sure where to post, but I wanted to raise the point that lack of support for MS excel "format as table" creates accessibility issues. "Format as table" is the most widely supported technique for screen readers to properly associate column headers.

Here's a link to the official guide for making accessible Excel files (for meeting US laws):
https://www.section508.gov/create/spreadsheets

It seems like "format as table" is realized using pivot tables...

Related issues on github: #972 #840 #358
Related questions on stackoverflow:
https://stackoverflow.com/questions/55907831/phpspreadsheet-tables-get-lost-in-the-process
https://stackoverflow.com/questions/50934401/phpspreadsheet-multiple-tables-with-format-as-table-in-excel-worksheet

Adrien Crivelli
@PowerKiKi
@briancstevens the best that could happen for feature request like this one is for someone, maybe you, to start working on it and suggest a PR. Unfortunately we typically don't have the time to implement new features
Fräntz Miccoli
@frantzmiccoli
@PowerKiKi Perfectly understandable, thanks for the update and the compliments!
briancstevens
@briancstevens
@PowerKiKi Understood, thanks for the reply!
Alan Christian Ruiz Aguirre
@achristian92
how to save PhpSpreadsheet(excel) in amazon s3 ??? help
FlaviuRadulescu
@FlaviuRadulescu
Hello everybody. Is there an equivalent of "Format Painter" option from excel?
I need to copy the format of a merged cells to another cells and the duplicateStyle copy just the format not the merge property of the cells
Thomas Kristian Jeriko
@jerikothomas
hello i have question about "How to use time values (hh:mm:ss) on chart ?"
moschel26
@moschel26

Hello. I want to ask. How do I make a data automatically move to a new page if the data is separate in the php excel?
I have dynamic data. So my data can change
besides that I also have a data signature that cannot be separated.
This signature data must be on the same page. See the red mark in this image :

enter image description here

It is a unit and cannot be separated. Signature data
must be on the same page

My problem is because my data is dynamic. This makes the position of the signature data can be located in any position. See image below :

enter image description here

Because my data increases, the position of the headmaster in the signature data is separate

How do I make signature data (see picture 1), which red marks automatically move to the next page if the data is separate?

sgfgdf
@sgfgdf_twitter
Hello, guys! Can someone tell me why PhpSpreadsheet strips some non-printable characters when reading from HTML – https://www.pastery.net/xumcsb/? Note the special character (0xa0) between FOO, BAR and BAZ.
sgfgdf
@sgfgdf_twitter
It appears that this was introduced by PHPOffice/PHPExcel#514, which makes different readers inconsistent. If you save the files as xls and read it with PhpOffice\PhpSpreadsheet\Reader\Xls instead of PhpOffice\PhpSpreadsheet\Reader\Html if will preserve the cells content as is.
sgfgdf
@sgfgdf_twitter
Also this replaces more than one space with single space, which is not correct. If you have the following string in a cell foo bar (2 spaces between foo and bar), it will be parsed as foo bar (one space between foo and bar).
zi5t0
@zi5t0
Hi guys, is there anyone here?
Valentin
@Momentomore

hey,
i use the following notation to generate xlsx and send them to user and its working fine on desktop
header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");'.'
header("Content-Disposition: attachment; filename=' . "01simple.xlsx".'");
header("Cache-Control: max-age=0");

However, when user tries to open file on Ipad he get xml formatted page insted. any suggestions?

Valentin
@Momentomore
nvm, i fixed it. MIME type was not overwriting and was text/html for some reason
AnilKumarBoddu
@AnilKumarBoddu
hi guys,
I need to create a excel sheet with read and write operation in php(codeigniter), please suggest me a best way
Thanks in advance
sgfgdf
@sgfgdf_twitter
Can someone can confirm or deny if the thing that I've reported is a bug or not?
Adrien Crivelli
@PowerKiKi
@sgfgdf_twitter it might be on purpose to trim some whitespaces as HTML does act that way. All whitespaces are rendered as if there is a single one in a browser. Off the top of my head I don't see workaround that could allow you to read exactly what is in the HTML. I'd be tempted to accept a patch to only trim starting and trailing white spaces...