KoolReport's Forum

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

Combine dataStore #1868

Open Epitello opened this topic on on Jan 25, 2021 - 3 comments

Epitello commented on Jan 25, 2021

Hello, i would know if it's possible to combine 2 dataStore in one other dataStore. Thanks by advance

KoolReport commented on Jan 26, 2021

You can join or leftJoin two datastores to become one DataStore Join Methods.

Epitello commented on Jan 26, 2021

it's cool but when i try it i have this error : Warning: Invalid argument supplied for foreach() in C:\wamp64\www\koolreport\koolreport\core\src\core\DataStore.php on line 1289 i send you the code :

$this
        ->src('assurance')
        ->query($queryStr)
        ->pipe(new \koolreport\processes\ColumnMeta([
            /* "date" => [
                "type" => "datetime",
                "format" => "d-m-Y"
            ],
            "montant" => [
                "type" => "number",
                "decimals" => 2,
                "decimalPoint" => ".",
                "thousandSeparator" => " "
            ], */
        ]))
        ->pipe($this->dataStore('assuranceDS'));

        $this
        ->src('assurance')
        ->query($queryStr2)
        ->pipe($this->dataStore('assuranceDS2'));

        $this->new_store = $new_store =  $this->dataStore('assuranceDS')->leftJoin($this->dataStore('assuranceDS2'),array("id_test"=>"id_toto"));
KoolReport commented on Feb 3, 2021

Please do the leftJoin in the view:

MyReport.view.php

<?php
$new_store =  $this->dataStore('assuranceDS')->leftJoin(
    $this->dataStore('assuranceDS2'),
    array("id_test"=>"id_toto")
);
?>

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
None yet

None