KoolReport's Forum

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

Pass Variable from Index to Report #1305

Closed Frank DiGiandomenico opened this topic on on Feb 17, 2020 - 5 comments

Frank DiGiandomenico commented on Feb 17, 2020

How can I pass variables from my index.php file to MyReport.php and ultimately MyReport.view.php to display in the view? Here's my code:

index.php

<?php
require "MyReport.php";

$billID = $_GET['billID'];

$pdf = new MyReport;
$pdf->export()
    ->settings(array(
        "useLocalTempFolder"=>true,
    ))
    ->pdf(array(
        "format"=>"A4",
        "orientation"=>"portrait"
    ))->toBrowser("MyReport.pdf");

How can I pass the $billID variable to MyReport.php and use/display it in MyReport.view.php?

KoolReport commented on Feb 18, 2020

Please view this topic.

Frank DiGiandomenico commented on Feb 18, 2020

Thank you.. I read over that topic, and I understand how to pass $billID to MyReport.php. But how do I use the $billID variable in MyReport.view.php ?

KoolReport commented on Feb 18, 2020

You can get parameter in the same way you did in MyReport.php: $this->params["billID"] for example.

Frank DiGiandomenico commented on Feb 18, 2020

Great, thank you very much! That worked!

KoolReport commented on Feb 18, 2020

Awesome!

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
solved

Export