KoolReport's Forum

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

Export package - pass parameters #334

Open EGROW SOLUTIONS, LLC opened this topic on on Jun 23, 2018 - 5 comments

EGROW SOLUTIONS, LLC commented on Jun 23, 2018

Hello I am using export package to print reports dynamically - How do I pass parameters to the export file How do I pass id to the filename?

$strFileName = 'myReport.php';
$id = $_POST['id']
require_once("/koolreport/autoload.php");
   use \koolreport\instant\Exporter;
   Exporter::export($strFileName)
    ->pdf(array(
        "format"=>"A4",
        "orientation"=>"portrait"
    )) ->toBrowser("out.pdf",true);
KoolReport commented on Jun 24, 2018

Hi,

May be inside myReport.php, you do sth like this

<?php
//myReport.php
$id = $_POST['id'];
//now you have the $id

ike commented on Jan 17, 2019

I need to generate pdfs on the fly based on some supplied data

foreach ($array_data as $data) {

Exporter::export($strFileName, $data)
->pdf(array(
    "format"=>"A4",
    "orientation"=>"portrait"
)) ->toBrowser("out.pdf",true);

}

ike commented on Jan 17, 2019

rr

ike commented on Jan 17, 2019

I needed to do generate pdfs dynamically based on some supplied data like so

foreach ($array_data as $data) {
	// generaten pdf
	Exporter::export($strFileName, $data)
    ->pdf(array(
        "format"=>"A4",
        "orientation"=>"portrait"
    )) ->toBrowser("out.pdf",true);
}

Please i need help urgently

KoolReport commented on Jan 18, 2019

Currently the Exporter does not support argument like above, you may setup a full report for exporting or wait for next version of Instant package.

This will not work to push series of files to browser like above. Only single file should be pushed to browser to open. The multiple PDF generated only support saving to server drive with saveAs() method.

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