KoolReport's Forum

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

Ajax loading a select input #772

Open iRiyada opened this topic on on Apr 1, 2019 - 6 comments

iRiyada commented on Apr 1, 2019

I have two select inputs 1)select sector 2)select department
After user selects sector, department selection choices must be dynamically loaded -subreporting is throwing errors. Is there any other way to dynamically bind datasource based on other input selection

iRiyada commented on Apr 1, 2019

How o do subreport in laravel?

KoolReport commented on Apr 1, 2019

You may follow exactly our subreport example. Basically you just need to make a sub report containing the inputs. Instead of posting directly through post back you will call subReport.update() to update selection of user to the sub report. Base on what user select, you may change the next dropdown. In our example, please pay attention to the CustomerSelecting sub report.

iRiyada commented on Apr 1, 2019

trigger_error("Could not find [$name] subreport, please define this report in the ".Utility::getClassName($this)."::settings()",E_USER_WARNING); Is there any particular settings to be made in laravel?

KoolReport commented on Apr 1, 2019

Please look at the CustomerOrders report, this is the main report that hold subreports like CustomerSelecting. In the main report you need to specify the list of sub reports. Please look at the CustomerOrders in our example for more details

iRiyada commented on Apr 1, 2019

I did it the same way, as given in your example. Except laravel is used.. so instead of index, there is a controller and rendered in view.blade.php

KoolReport commented on Apr 2, 2019

From the error, I see that either you have not added list of subreport in main one ( you said you did) or the name is mismatched. For example, if you specify

subReports=>array(
    "mySub"=>MySub::class
)

then when you call sub report update at client-side you need to do:

subReport.update('mySub',{});

please check the case-sensitivity

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