Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 03 23:58
    hedidntohyeshe starred PHPOffice/PhpSpreadsheet
  • Oct 03 20:35
    Mohammed4mach starred PHPOffice/PhpSpreadsheet
  • Oct 03 17:56
    developarts starred PHPOffice/PhpSpreadsheet
  • Oct 03 16:11
    brainfoolong commented #3102
  • Oct 03 16:10
    MarkBaker commented #3102
  • Oct 03 14:49
    MarkBaker assigned #3102
  • Oct 03 14:49
    MarkBaker labeled #3102
  • Oct 03 14:49
    brainfoolong commented #3102
  • Oct 03 14:48
    MarkBaker commented #3102
  • Oct 03 14:16
    MarkBaker commented #3102
  • Oct 03 12:44
  • Oct 03 11:54
    brainfoolong commented #3102
  • Oct 03 11:51
    brainfoolong commented #3102
  • Oct 03 11:51
    brainfoolong commented #3102
  • Oct 03 11:46
    MarkBaker commented #3102
  • Oct 03 11:44
    MarkBaker commented #3102
  • Oct 03 11:41
    brainfoolong commented #3102
  • Oct 03 11:41
    brainfoolong commented #3102
  • Oct 03 11:39
    brainfoolong commented #3102
Adrien Crivelli
@PowerKiKi
@kristofermagic try composer install so that composer re-generate the autoloader
there is nothing specific with ZF3
oh, and of course triple-check that you require_once 'vendor/autoload.php'; somewhere in your project, but that must be already the case if you use ZF3
on a final note, use triple backticks (`) blocks to properly format code in this chat
VertZu
@VertZu
$KolumnDate = 1; // kolumn 1 = B
for ($RowDate = 1; $getOrder->getCellByColumnAndRow($KolumnDate,
$RowDate)->getFormattedValue() == "4/1/2019"; $RowDate++) {
if ($getOrder->getCellByColumnAndRow($KolumnDate, $RowDate)->getFormattedValue() == "4/1/2019" );
{
echo $RowDate;
}
}
Returns NULL Whats wrong?
Adrien Crivelli
@PowerKiKi
@VertZu please format your code correctly with markdown syntax if you wanna get helped
Michel Ojeda
@kristofermagic
@PowerKiKi Thanks a lot. I appreciate your help. I'll try and let you know about it.
Michel Ojeda
@kristofermagic
@PowerKiKi Sorry it does not work for me. I tried but I was checking on my z-ray and I saw in the classes map and I could not be able to see PhpSpreadsheet for anywhere.
Jérémie Asaro
@jeremie.asaro_gitlab
Hello everybody
If somebody can help, that would be super nice
I just made the migration of a project using PHPExcel to PHPSpreadsheet, and all is fine BUT one thing
Messed up Cell Background Color
and it's driving me crazy because it has a high visual impac
I load an Excel Template Sheet, then Fill it in, then Save it
and in the process, without even touching some cell, it changes some of their background color
which did not happen at all in PHPExcel
Jérémie Asaro
@jeremie.asaro_gitlab
if i switch the template from XLS to XLSX, i get different cell changed & different color result
if i open & save the template with LibreOffice, same
so I guess there is something off with PHPSpreadsheet way of handling Cell Background Color
Adrien Crivelli
@PowerKiKi
@jeremie.asaro_gitlab the best would be to create a Minimal, Complete, and Verifiable example of code that exhibits this issue and submit an issue, or even better a PR for it.
Stephen Ostrow
@isleshocky77
I have a .xlsx file which looks to be generated by SpreadsheetLight (based on looking at the theme.xml file). PhpSpreadsheet is not accurately opening it. Has anyone else seen issues like this? Where do I begin to debug this?
Note LibreOffice opens the file just fine without any type of warnings or issues.
hemant123misha
@hemant123misha
hi
I have a .xls file having a formula in formula bar, when i am trying to read it out by calculated value getting formula error.
xeon826
@xeon826
Is it possible to generate the download to php://output without writing it to the file system first?
I have an SQL query that returns the rows in json format, I'd like to just convert it straight to csv, or xls and generate a download
Adrien Crivelli
@PowerKiKi
@xeon826 no, it's not, see https://github.com/PHPOffice/PhpSpreadsheet/issues/28#issuecomment-399120802 and the other related posts over there
Timothy
@tdawes33
Is there a way to get the hash of a sheet before loading it? It seems like listWorksheetInfo() would provide that if it exists Doing a compare between two identical (and complex) sheets requires loading/processing the entire sheet according to my understanding.
Thomas Kristian Jeriko
@jerikothomas
is there a way to create chart from time (over 24 hours) base values ?
Fräntz Miccoli
@frantzmiccoli
@jerikothomas you have an example of line chart here that I guess you can adapt to your data. https://github.com/PHPOffice/PhpSpreadsheet/blob/master/samples/Chart/33_Chart_create_line.php
Ram Mogal
@rammogal
Hi , I am using phpspreadsheet library in Zedn 3 Framework.
Hi , I am using phpspreadsheet library in Zedn 3 Framework.
I have copied the folder and pasted it in my vendor directory, now how can I register this library and use its namespaces in my own module
Stephen Ostrow
@isleshocky77
Is there anywhere documenting the Release process and Schedule? I see the next milestone is for 2.0; however, the last release was 1.6 on Jan 1. There are very useful commits on master fixing bugs within the codebase. Will there be a 1.6.1 or 1.7 which come out before 2.0 ?
Adrien Crivelli
@PowerKiKi
@rammogal copying the folder will not work, instead delete the things you copied and follow the instruction there: https://phpspreadsheet.readthedocs.io/en/latest/#installation
@isleshocky77 there is no formal release schedule. I try to release roughly every month, but I've been particularly busy lately. I'll see what I can do in the coming days...
Stephen Ostrow
@isleshocky77
@PowerKiKi Awesome.. Yeah, I saw you were releasing monthly if not bi-monthly for the last part of 2018 (which got me excited), but that release is now Jan 1. I've pinned my dependency to dev-master#commitish for now. Thanks for the response and for the hard work. Interesting enough I came across the getHighestColumn() bug today and thought I must be crazy or using it wrong. Then I found the Unit test and fix for it which happened very recently. Worked like a charm.
Rico29
@Rico29
Hello, I'm trying for hours to get the background color of a cell in an ODS file. I tried many many ways, but I never found what I'm looking for. can somebody point me in the right direction please ?
Rico29
@Rico29
It works fine when converting file to xlsx, with $spreadsheet->getActiveSheet()->getStyle('B2')->getFill()->getStartColor()->getRGB();
deepakjoshii
@deepakjoshii
3.00 values changes to 3 in excel sheet
graslo
@graslogamer_twitter
Just installed with composer. Trying out samples but can't find them. Where is the /tmp/ folder supposed to be?
Running sample tells me: "20:49:40 Write Xlsx format to /tmp/phpspreadsheet/01_Simple.xlsx in 0.0325 seconds"
But can't find that anywhere
Adrien Crivelli
@PowerKiKi
@graslogamer_twitter /tmp/phpspreadsheet/01_Simple.xlsx is an absolute path. It exists at the root of your filesystem, not in your current folder/project. Copy/paste that path exactly as is in your favorite spreadsheet editor and it should be able to find it
graslo
@graslogamer_twitter
@PowerKiKi thank you
Salman Tariq
@stariqmi
Is there a migration guide from PHPExcel to PHPSpreadsheet? I have to upgrade to PHP 7.3 and can no longer use PHPExcel
Salman Tariq
@stariqmi
Sorry - I should have searched more. Found the doc from searching stackoverflow :)
Olaitan .M. Adeboye
@Mercyware
Hello
I am trying to get Images from excel using getDrawingCollection(). However, i need to be able to know the cell that has the image. Is that possible ?
Adrien Crivelli
@PowerKiKi
@Mercyware try
$spreadsheet->getActiveSheet()->getDrawingCollection()[0]->getCoordinates();
dack94
@dack94

Hi all :) I'm creating an excel with PhpSpreadsheet (no prob with that ). I'm working with MVC pattern so flow is :
1) User press download button and call function in controller
2) function in controller call a function in an helpers to create the excel

Now it's a very very long task and i'd like to show the progress of this long task (like a download bar). I've tried with all things that i know (ajax polling , iframe, sse, session variable, static variable) but none seems to work. Could you help me ?

Adrien Crivelli
@PowerKiKi

@dack94 I did exactly what you are talking about a long time ago, and it's a surprisingly trick thing to do. I would try to avoid it actually. One serious limitation with normal ajax thing is the browser limitation of 2 connection to a given server. So in some condition, your ajax polling might not actually start before the excel file is done generating. Anyway here is my solution that you will have to adapt.

Utility Class:

<?php

namespace Application\Utility;

/**
 * This class implements ways to know when a long process is running on
 * the server and when the said process is complete.
 *
 * This file *MUST NOT* be part of Zend code because it has to be accessible concurrently
 * to any process that may occur at the same time by another HTTP request. Hence we
 * cannot use session and cannot use ACL security system neither. It must stay totally
 * separated from all other code.
 */
abstract class Progress
{
    private static $currentIdProgress = '';

    /**
     * Returns the path for the path for the lock file for the specified ID of progress
     *
     * @param string $id
     *
     * @return string
     */
    private static function getLockFilePath(string $id): string
    {
        // Here we use MD5 to prevent security hole to access filesystem with '.' or '/' characters in $id
        return __DIR__ . '/data/tmp/progress_' . md5($id) . '.lock';
    }

    /**
     * Notify the beginning of a long process
     *
     * @param string $id
     */
    public static function start(string $id): void
    {
        self::$currentIdProgress = $id;
        touch(self::getLockFilePath($id));
    }

    /**
     * Notify the end of a long process
     */
    public static function end(): void
    {
        $path = self::getLockFilePath(self::$currentIdProgress);
        if (file_exists($path)) {
            unlink($path);
        }
    }

    /**
     * Allow to poll the status of a progress by its ID
     *
     * @param string $id id of progress
     *
     * @return string current status of progress
     */
    public static function status(string $id): string
    {
        if ($id && file_exists(self::getLockFilePath($id))) {
            return $id . ' in progress ...';
        }

        return '';
    }
}

Then your javascript would start the download with an arbitrary "process id". Any string generated in JS. When starting to generate the excel file and you receive that id in PHP, you would call:

Progress::start($_REQUEST['id']);
$spreadsheet = createMySpreadsheet();
Progress::end();
sendSpreadsheetToBrowser($spreadsheet);

In parallel the JS would start to poll a different endpoint. That endpoint MUST be completely separate from your application and it MUST NOT use PHP session at all. In that new endpoint you use:

<?php

/**
 * This file *MUST NOT* be part of Zend code because it has to be accessible concurrently
 * to any process that may occur at the same time by another HTTP request. Hence we
 * cannot use session and cannot use ACL security system neither. It must stay totally
 * separated from all other code.
 */
require_once __DIR__ . '/../vendor/autoload.php';
echo \Application\Utility\Progress::status($_REQUEST['id']);

The JS can then show an non-deterministric progress bar, until the endpoint says it's over

ahsanmahmood
@ahsanmahmood
i am new with php sread sheet