Hi giovannino ,
I try to intregate your solution, but I have always a blank result screen(debugsql=false) or sql query displayed (debugsql=true) !!!
I detail all my codes, maybe you will have an idea for what’s happen !!
NOT: sql query displayed is not the query in sc but the query in ireports document ???
Thanks in advance
Nac
Button code in sc :
$pdf_query=“SELECT
bnotes.BNCLEUNIK
AS bnotes_BNCLEUNIK,
bnotes.MONTANT
AS bnotes_MONTANT,
bnotes.CASH
AS bnotes_CASH,
bnotes.NROOM
AS bnotes_NROOM,
bnotes.NUMERO
AS bnotes_NUMERO,
bnotes.GUESTNAME
AS bnotes_GUESTNAME,
bnotes.DATEFIN
AS bnotes_DATEFIN,
bnotes.DATEDEB
AS bnotes_DATEDEB
FROM
bnotes
bnotes
WHERE
bncleunik=’”.{bncleunik}."’";
$xml_file=“facvv.jrxml”;
sc_set_global($pdf_query);
sc_set_global($xml_file);
$_SESSION[‘report’][‘xml_file’]=$xml_file;
$_SESSION[‘report’][‘pdf_query’]=$pdf_query;
sc_redir(…/ireports/index.php);
INDEX.PHP codes in ireports directory :
<?php
session_start();
include_once(‘class/tcpdf/tcpdf.php’);
include_once(‘class/PHPJasperXML.inc.php’);
$xml = simplexml_load_file($_SESSION[‘report’][‘xml_file’]); //variable for jrxml file
$PHPJasperXML = new PHPJasperXML();
$PHPJasperXML->debugsql=true;
$PHPJasperXML->arrayParameter=array(‘pdf_query’=>$_SESSION[‘report’][‘pdf_query’]); //variable for sql statement
$PHPJasperXML->xml_dismantle($xml);
$PHPJasperXML->transferDBtoArray($_SESSION[‘report’][‘host’],
$_SESSION[‘report’][‘user’],
$_SESSION[‘report’][‘pass’],
$_SESSION[‘report’][‘db’]);
$PHPJasperXML->outpage(“D”); //page output method I:standard output Download file
?>
DIRECTORIES CONTENTS:
in my project directory, I have :
ireports directory
class sub-directory (containing PHPJasperXML-master class sub-directory)
index.php
facvv.jrxml