KoolReport's Forum

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

Table sub report #2722

Closed Edp Ferrino opened this topic on on Jun 13, 2022 - 6 comments

Edp Ferrino commented on Jun 13, 2022

Hello, I have a report which is based on the query

select codice, descrizione, qta from magazzino

		Table::create(array(
    		"dataStore"=>$this->dataStore('my_data'),
    		"columns"=>array(
        		"descrizione"=>array(
            		"label"=>"Desc.",
            		"type"=>"string",
        		),
        		"qta"=>array(
            		"label"=>"Q.tà",
            		"type"=>"number",
            		"prefix"=>"#",
        		)
    		),
    		"cssClass"=>array(
        		"table"=>"table table-hover table-bordered"
    		)
		));    

It works very well, I see what I want. But now I want to see a sub-report based on the query for each record

select scatola, codice, qta from scatole

the two queries are joined by the two codice fields. How can I do?

Sebastian Morales commented on Jun 14, 2022

Pls check our sub report example here:

https://www.koolreport.com/examples/reports/others/subreport_demo/

Instead of using select, you could use Table with its client events:

https://www.koolreport.com/docs/koolphp/table/#table-settings-client-events

Or DrillDown could be useful for you:

https://www.koolreport.com/examples/reports/drilldown/drilldown/

Edp Ferrino commented on Jun 14, 2022

This example not run

https://www.koolreport.com/examples/reports/others/subreport_demo/

For me it's impossible if that's what I want. Other example it's not my need

Sebastian Morales commented on Jun 14, 2022

Do you use any framework like Laravel, Symphony, etc and turn on CSRF token?

Edp Ferrino commented on Jun 14, 2022

No

Sebastian Morales commented on Jun 14, 2022

Pls open your report web page's dev tool (F12) to see if there's any js error in console. If not, go to tab Network, button XHR to see xhr request when changing Country or Customer select. Click on the xhr request to see if there's any error message in the response's content.

Edp Ferrino commented on Jun 14, 2022

Sorry, my mistake, the example works. It was I who did not see the field to be selected. The fact remains that this is not how I want it to work either. I solve it using a pivot. A thousand 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
None yet

None