KoolReport's Forum

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

Laravel: Parameter in report #1395

Closed Eugene opened this topic on on Apr 20, 2020 - 2 comments

Eugene commented on Apr 20, 2020

Could you give an example of how to send parameters to the report in Laravel case?

I meant if I have a date picker in my blade view how to send the value to the report and how is it better to create parameters field - using koolreport controls or via Laravel?

KoolReport commented on Apr 20, 2020

When you have a datepicker as input, there are two ways:

1-Put the datepicker inside the blade view of Laravel, on upon receiving values posted, you sent value to report to display chart. So you will send the parameters to report like this:

$report = new MyReport(array(
    "date"=>$myDate, // $myDate is from your datepicker posted back.
));
$report->run();

2-Use the datepicker inside the report itself, then you can use the datepicker from inputs package. Please follow the inputs guidance. In this way, the datepicker will bind its value to the report's parameter. So you can init your report at normal:

$report = MyReport;
$report->run()->render();

In this way, you do not need to insert date parameters to the report, the report will renders the datepicker and then when user selects a date to submit, the report will receive "date" parameter through $this->params["date"].

Eugene commented on Apr 20, 2020

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

Laravel