KoolReport's Forum

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

Pass parameters? #3407

Open Jeff Bade opened this topic on on Jan 4 - 1 comments

Jeff Bade commented on Jan 4

Can i make a report that has a parameter in the url?

Https://www.somewebsite.com/reports/newreport.php?personid=1234

So that the sql will have a where personid=1234

Is this possible?

Sebastian Morales commented on Jan 13

Yes, it is. In your newreport.php page you can get the person id using $_GET["personid"] and pass it to your report class like this:

//newreport.php
$personId = $_GET["personid"];
$report = new MyReport(array(
    "personId" => $personId
));

Then in your report php you can access this person id with report params property:

//MyReport.php
...
function setup() {
    $personId = $this->params["personId"];
    ...
}

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