<?php
include_once ‘path_to_phpjasperxml/PHPJasperXML.inc.php’;//in this case, phpjasperxml is your submodule from github

$PHPJasperXML = new PHPJasperXML(«en»,»TCPDF»); //if export excel, can use PHPJasperXML(«en»,»XLS OR XLSX»);
//$PHPJasperXML->debugsql=true;
$PHPJasperXML->arrayParameter = array(‘para1’=>’1′,’para2’=>’2’);
$PHPJasperXML->load_xml_file(‘file1.jrxml’); //if xml content is string, then $PHPJasperXML->load_xml_string($templatestr);
//$PHPJasperXML->sql = $sql; //if you wish to overwrite sql inside jrxml
$dbdriver=»mysql»;//natively is ‘mysql’, ‘psql’, or ‘sqlsrv’. the rest will use PDO driver. for oracle, use ‘oci’

$PHPJasperXML->transferDBtoArray(DBSERVER,DBUSER,DBPASS,DBNAME,$dbdriver);
$PHPJasperXML->outpage(‘I’); //$PHPJasperXML->outpage(‘I=render in browser/D=Download/F=save as server side filename according 2nd parameter’,’filename.pdf or filename.xls or filename.xls depends on constructor’);
Continua leyendo «PhpJasperXML»

Entradas relacionadas

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *