-
Notifications
You must be signed in to change notification settings - Fork 3
/
reporteTest.php
51 lines (35 loc) · 1.23 KB
/
reporteTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
//Import the PhpJasperLibrary
include_once('PHPJasperXML/tcpdf/tcpdf.php');
include_once("PHPJasperXML/PHPJasperXML.inc.php");
//database connection details
$opc=$_GET["opc"];
$orden=$_GET["orden"];
$server="localhost\sqlexpress";
$db="sistema";
$user="sa";
$pass="123";
$version="0.9d";
$pgport=5432;
$pchartfolder="./class/pchart2";
$cndriver="sqlsrv";
//display errors should be off in the php.ini file
ini_set('display_errors', 0);
//setting the path to the created jrxml file
$xml = simplexml_load_file("report2.jrxml");
$PHPJasperXML = new PHPJasperXML();
//$PHPJasperXML->debugsql=true;
$PHPJasperXML->xml_dismantle($xml);
$PHPJasperXML->transferDBtoArray($server,$user,$pass,$db,$cndriver);
$PHPJasperXML->outpage("I"); //page output method I:standard output D:Download file
/*
$xml = simplexml_load_file("report2.jrxml");
$PHPJasperXML = new PHPJasperXML("en","XLS");
//$PHPJasperXML->debugsql=true;
//$PHPJasperXML->arrayParameter=array("parameter1"=>$orden);
$PHPJasperXML->xml_dismantle($xml);
//$PHPJasperXML->load_xml_file("report1.jrxml");
$PHPJasperXML->transferDBtoArray($server,$user,$pass,$db,$cndriver);
$PHPJasperXML->outpage("I","report1.xls");
*/
?>