KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Excel To Table #1383

Open sevgi opened this topic on on Apr 13, 2020 - 5 comments

sevgi commented on Apr 13, 2020

when downloading excel table:

  1. change header background color
  2. adding date information to the last column
sevgi commented on Apr 13, 2020

I need report title merge and center cell

David Winterburn commented on Apr 15, 2020

Hi Sevgi,

Regarding your questions:

a. 1 and 3 could be done with excel template export by using text and table widgets with style array:

https://www.koolreport.com/docs/excel/excel_widgets

b. 2 could be done by add a date column before piping to your datastore. For example:

$this->src(...)
...
->saveTo($node1);

$node1->pipe($this->dataStore("myDatastore");

$node1->pipe(new \koolreport\core\Map(array(
    "{value}" => function($row) {
        $row["dateColumn"] = date('Y-m-d');
        return $row;
    }
)))
->pipe($this->dataStore("myDatastoreExcel");

Let us know if we understood your questions correctly. Thanks!

sevgi commented on Apr 15, 2020

Fatal error: Uncaught Error: Call to undefined method Closure::meta() in /var/www/html/cafm/app/webroot/report/koolreport/excel/Table.php:330 Stack trace: #0 /var/www/html/cafm/app/webroot/report/koolreport/excel/Table.php(50): koolreport\excel\Table::saveDataStoreToSpreadsheet(Object(Closure), Object(Box\Spout\Writer\XLSX\Writer), Array) #1 /var/www/html/cafm/app/webroot/report/koolreport/excel/BigSpreadsheetExportHandler.php(185): koolreport\excel\Table::saveContentToSpreadsheet(Array, Object(Box\Spout\Writer\XLSX\Writer), Array) #2 /var/www/html/cafm/app/webroot/report/koolreport/excel/BigSpreadsheetExportHandler.php(232): koolreport\excel\BigSpreadsheetExportHandler->exportToSpreadsheet('table', 'Rapor-AExcel', Array) #3

sevgi commented on Apr 15, 2020

date column not visible ;

$dataStore = $this->gethelpDeskAnnualReportPipes();

    $dataStore->pipe(new Map(array(
        "{value}" => function($row) {
            $row["dateColumn"] = date('Y-m-d');
            return $row;
        },
    )))->pipe($this->dataStore($this->reportName));
David Winterburn commented on Apr 15, 2020

Please post your report, export and export view code. Thanks!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Excel