KoolReport's Forum

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

Pivot Table Create Based on array of query result #3077

Open Ankit Agarwal opened this topic on on Jun 14, 2023 - 2 comments

Ankit Agarwal commented on Jun 14, 2023

Pivot Table Create Based on array of query result and it should be in one blade file as for example multiple file not required

\koolreport\pivot\widgets\PivotTable::create(array(
        "dataSource" => $query_result,
        
        "showDataHeaders" => true,
    ));

Inside above class need to define all column and row settings of myreport.php and myreport.view.php like..

Ankit Agarwal commented on Jun 14, 2023

Output it's showing last row only, i have more than 100 rows..

my code is:

\koolreport\pivot\widgets\PivotTable::create(array(
        "dataSource" => $query_result,
        
        "showDataHeaders" => true,
    ));

I need output like:

query output is: 0 => {#2203 ▼

+"Location": "AZ"
+"Product": "1.5W LED Module WLL2 SOL WW"
+"Watt": "1.50"
+"Model": "WLL2"
+"Division": "LED"
+"Qty": "188"
+"CP": "0"
+"Amount": "0"

} 1 => {#2205 ▼

+"Location": "AZ"
+"Product": "1000W LED Module TC SOL CW"
+"Watt": "1000.00"
+"Model": "TC"
+"Division": "LED"
+"Qty": "9"
+"CP": "0"
+"Amount": "0"

} 2 => {#2206 ▼

+"Location": "AZ"
+"Product": "100W LED Module F20 SOL CW"
+"Watt": "100.00"
+"Model": "F20"
+"Division": "LED"
+"Qty": "2272"
+"CP": "0"
+"Amount": "0"

} ...

Sebastian Morales commented on Jun 19, 2023

You can use SinglePage report like documented here:

KoolReport single page report

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

None