Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 02 2019 01:38

    PowerKiKi on 1.8

    Permanently archive the project… (compare)

  • Dec 25 2018 02:52
    yuyuanxia opened #1433
  • Dec 18 2018 18:19
    arya108 commented #443
  • Dec 17 2018 22:01
    dpbuzz opened #1432
  • Dec 17 2018 16:17
    csrnontol commented #1351
  • Dec 17 2018 13:20
    sirber commented #1351
  • Dec 17 2018 04:22
    csrnontol opened #1431
  • Dec 17 2018 04:05
    csrnontol commented #1351
  • Dec 14 2018 06:57
    radekdostal closed #1430
  • Dec 14 2018 06:57
    radekdostal commented #1430
  • Dec 14 2018 06:48
    radekdostal opened #1430
  • Dec 10 2018 09:02
    cifren closed #205
  • Dec 07 2018 05:09
    mrmoll commented #1429
  • Dec 07 2018 05:07
    mrmoll opened #1429
  • Dec 06 2018 10:51
    pranavwhiz commented #1304
  • Dec 06 2018 10:50
    pranavwhiz commented #1304
  • Dec 05 2018 13:46
    enfoqueNativo opened #1428
  • Dec 05 2018 08:15
    myloveGy edited #1427
  • Dec 05 2018 08:10
    myloveGy opened #1427
  • Dec 05 2018 05:46
    billynoah commented #1096
a competent programmer
@xiatian
nice work
Martin Tillmann
@Mtillmann
Hi Guys, sorry if this is too specific and not project related enough, however: Do you think it would be possible to extract logic from embedded formulae and store that logic in some abstract (or not so abstract) way and run it later using different data? My proposed use case is to import an large excel file containing data AND logic but to execute certain logic parts (formulae) later on, independently from the excel file
Adrien Crivelli
@PowerKiKi
@Mtillmann we did exactly that, stored Excel girls in DB with custom syntax instead of cell references and leveraged PHPExcel calculation engine to compute results on the fly. It worked very well for us. If that interest you I may give you more info later. For not it's time to sleep for me...
s/girls/formulas/ ==;
Martin Tillmann
@Mtillmann
@PowerKiKi thank you very much for your helpful reply. My scope may have already shifted as apparently the files in question do not only use formulas but also macros. I am currently evaluation node's "xlsx" but i guess most of the logic will have to be reimplemented :worried: have a nice weekend!
Adrien Crivelli
@PowerKiKi
@Mtillmann macros will be hard I guess... if you ever come back to PHP, then go for PhpSpreadsheet instead of PHPExcel
Adrien Crivelli
@PowerKiKi
hey all, I am looking for opinions about a potential license change/upgrade in PHPOffice/PhpSpreadsheet#140. Feel free to chime in !
anuluvi
@anuluvi
Can we use this with Zend Framwork?
Actually I am new to Zend. Dont know how to implement.
Adrien Crivelli
@PowerKiKi
@anuluvi, sure ! Zend Framework or pretty much any other frameworks out there
there are probably many ways to integrate into Zend Framework, but you may have a look at the following commit to get at least some ideas: Ecodev/gims@41dd4a5
Adrien Crivelli
@PowerKiKi
the key classes here are ExcelModel, ExcelRenderer and ExcelStrategy
if you do go that route, you should first have a look at that commit to see what files were introduced, but then have a look at master branch to see the latest versions of thoses files. They probably changed a bit in between...
Adrien Crivelli
@PowerKiKi
Also if you are starting a new project now, you may want to go with PhpSpreadsheet, even if it's not quite yet released...
Martin Tillmann
@Mtillmann
@PowerKiKi thank you, I was already aware of PhpSpreadsheet!
andyaaron
@andyaaron
hey folks, can anyone link me to a good guide on outputting an xlsx file into an html table via excelreader?
Adrien Crivelli
@PowerKiKi
@andyaaron by "excelreader" do you mean "PHPExcel" ?
anuluvi
@anuluvi
@PowerKiKi If someone help me to integrate PHPExcel in Zend Framwork 1.2, that would be appreciated. thanks in advance from India (y).
andyaaron
@andyaaron
thanks @PowerKiKi
Adrien Crivelli
@PowerKiKi

@anuluvi you could try something like the following:

A view helper to send Excel files:

<?php

namespace Application\View\Helper;

use PHPExcel;
use PHPExcel_Writer_Excel2007;
use PHPExcel_Writer_HTML;
use Zend_View_Helper_Abstract;

/**
 * Send the excel document to the client as attached file
 */
class SendExcel extends Zend_View_Helper_Abstract
{
    /**
     * Send the excel document to the client as attached file
     * @param PHPExcel $workbook the workbook to send
     * @param string $filename the filename suggested to save as for the end-user
     * @param bool $debug if true, will output (approximative) HTML for easier debugging
     */
    public function sendExcel(PHPExcel $workbook, string $filename = 'output.xlsx', bool $debug = false): void
    {
        $workbook->setActiveSheetIndex(0);

        // Set common properties
        $workbook->getProperties()->setCreator(_tr('My application'));
        $workbook->getProperties()->setLastModifiedBy(_tr('My application'));
        $workbook->getProperties()->setTitle($filename);
        $workbook->getProperties()->setSubject($filename);

        if ($debug) {
            $objWriter = new PHPExcel_Writer_HTML($workbook);
        } else {
            $objWriter = new PHPExcel_Writer_Excel2007($workbook);

            // Save Excel 2007 file
            header('Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
            header("Content-Disposition: attachment; filename=\"$filename\"");
            header('Expires: 0');
            header('Cache-Control: must-revalidate, post-check=0,pre-check=0');
            header('Pragma: public');
        }
        $objWriter->setPreCalculateFormulas(false);
        $objWriter->save('php://output');
    }
}

A view.phtml using that helper:

<?php

// Create new PHPExcel object
$workbook = new PHPExcel();
$this->workbook = $workbook;

// Add some data
$workbook->getActiveSheet()->getCell('A1')->setValue('Hello World');

$filename = 'foo.xlsx';
$this->sendExcel($workbook, $filename);
Erick Wahyudi P.
@erick_wp_twitter
hi guys, can i create dropdown list in phpexcel with list sources from another sheet ?
Adrien Crivelli
@PowerKiKi
@erick_wp_twitter this should be what you are looking for: https://github.com/PHPOffice/PHPExcel/blob/1.8/Examples/15datavalidation.php
Erick Wahyudi P.
@erick_wp_twitter
thanks @PowerKiKi , my problem solved
good-web-master
@good-web-master
How to get a file from memory?
Something like the download method
Nenad Milivojević
@shone83
HI, I can't find a tutorial in which export data from mysql database into .xlsx excel format but with some columns format as text? Any help?
Adrien Crivelli
@PowerKiKi
@good-web-master you most likely write it to a temp file and then load it via PHPExcel
@shone83 have a look in the examples folder, you should find some that show how to format thing
good-web-master
@good-web-master
Bug : vendor\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel5.php in line 384, Fix:
$endCoordinates = PHPExcel_Cell::stringFromColumnIndex($iInc - 1);
Ghost
@ghost~55a299745e0d51bd787b23e9
what is PHPExcel_Cell::$_xfIndex? what does this variable represent
?
Mark Baker
@MarkBaker
XfIndex is a pointer to the style for the cell
Ghost
@ghost~55a299745e0d51bd787b23e9
will PHP excel be discontinued since phpspreadsheet is around?
Adrien Crivelli
@PowerKiKi
@gavinkalika yes it eventually will be
Ghost
@ghost~55a299745e0d51bd787b23e9
cool
@PowerKiKi is there a timeline of when that would happen?
Adrien Crivelli
@PowerKiKi
"soon" for a beta is the best I can do for now
Ahmed Attia
@ahmed0007
hi all iam new here
wind
@502923093
when i use wps edit the xlsx files ,then it loaded error happens
like this :ERROR: Allowed memory size of 335544320 bytes exhausted
i add it in class PHPExcel_Worksheet function: public function shrinkRangeToFit $range = str_replace('$', '', strtoupper($range)); it fixed the bug,but i don't know it can take other bugs?
Miko Chu
@meSmashsta
hello guys!
I have some questions about PHPExcel
Is anyone online?
Adrien Crivelli
@PowerKiKi
@meSmashsta, ask your question and somebody might answer
Miko Chu
@meSmashsta
How do I show the Excel file to the browser? You know like a preview before exporting it
Adrien Crivelli
@PowerKiKi
This could work:
$objWriter = new PHPExcel_Writer_HTML($workbook);
$objWriter->save('php://output');
Miko Chu
@meSmashsta
@PowerKiKi And that will show it to my browser like a pdf? Do I need to change the header too?
Adrien Crivelli
@PowerKiKi
Have look at http://phpspreadsheet.readthedocs.io/en/develop/topics/reading-and-writing-to-file/#html. That doc also applies to PHPExcel. And yes you'll have to remove any special headers you might be using when exporting Xls/Xlsx