KoolReport's Forum

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

PivotMatrix not displayed #346

Open Jure Zakrajsek opened this topic on on Jul 3, 2018 - 1 comments

Jure Zakrajsek commented on Jul 3, 2018

Hi

I have problems with displaying the PivotMatrix. PivotTable works fine.

https://arhiv.obscv.si/reports/meteor/index.php

Below the PivotTable I inserted the same code for a PivotMatrix

This is par of my MeteorCount.view.php

use \koolreport\pivot\widgets\PivotTable;
use \koolreport\pivot\widgets\PivotMatrix;

PivotTable::create(array(
    "dataStore"=>$this->dataStore('met_count'),
    'totalName' => 'Total',
    'rowCollapseLevels' => array(2),
));

PivotMatrix::create(array(
    "dataStore"=>$this->dataStore('met_count'),
    'rowCollapseLevels' => array(2),
));

And my MeteorCount.php has this query stored to dataStore

function setup()
{
    $this->src('metrec')
    ->query("select observer,camera,YEAR(obs_date) as ObsYear,MONTH(obs_date) as ObsMonth,DAY(obs_date) as ObsDay,met_shower from meteor_data_query")
   
    ->pipe(new Pivot(array(
        "dimensions" => array(
            "column" => "met_shower",
            "row" => "observer, camera, ObsYear, ObsMonth"
        ),
        "aggregates"=>array(
            "count" => "met_shower"
            )
    )))
    ->pipe($this->dataStore('met_count'));
}

--

From the html source it seems that the PivotMatrix object is created, but it is not displayed in the browser?

Halp would be appriciated. Best Jure

David Winterburn commented on Jul 4, 2018

Hi Jure,

Thanks for your feedback! It seems there's a javascript bug with the PivotMatrix widget when we don't set its paging object. We will fix this bug in the next version of the Pivot package. Meanwhile you could avoid it by adding the paging property this:

PivotMatrix::create(array(
    "id" => "pivotMatrix_met_count",
    "dataStore"=>$this->dataStore('met_count'),
    'rowCollapseLevels' => array(2),
    'paging' => array()
));

On a minor note, it's best practice to add an unique id to each widget like the above. 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
solved

Pivot