There was an error while loading. Please reload this page.
Render pdf is very easy, below is the source code.
<?php require __DIR__."/vendor/autoload.php"; use simitsdk\phpjasperxml\PHPJasperXML; $filename = __DIR__.'/sample.jrxml'; $data=[ ['user_id'=>0, 'fullname' => 'name1','email'=>'email1@a.com','gender'=>'M' ], ['user_id'=>1, 'fullname' => 'name2','email'=>'email2@a.com','gender'=>'F' ], ['user_id'=>2, 'fullname' => 'name3','email'=>'email3@a.com','gender'=>'M' ], ]; $config = ['driver'=>'array','data'=>$data]; $report = new PHPJasperXML(); $report->load_xml_file($filename) ->setDataSource($config) ->export('Pdf');
You shall avoid:
<?php
?>
** Refer all .php example to know different kind of implementation