Reportico - Report parameter passing

1k Views Asked by At

Please help me to pass report parameters to "Reportica report" through PHP code.

This is the method i tried:

PHP code:

require_once('../reportico/reportico.php'); 

$q = new reportico();

$q->initial_project = "loansys";
$q->initial_project_password = "k013";
$q->initial_report = "loansys.xml";
$q->initial_output_format = "HTML";
$q->embedded_report = true;

$q->allow_debug = true;
$q->forward_url_get_parameters = "";
$q->external_param1 = 1; 
$q->execute($q->get_execute_mode(), true);

Report Query:

SELECT l_number,due_number,due_date,amount,capital,interest
FROM  loan_due
WHERE l_number = {external_param1}

Error message:

Error: Error ( 1064) in Connection: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '})' at line 3

1

There are 1 best solutions below

0
On

My script:

        require_once('../reportico/reportico.php'); 
        $q = new reportico();
        $q->initial_project = "xxxx";
        $q->initial_project_password = "xxxx";
        $q->initial_report = "xxxx.xml";
        $q->initial_execute_mode = "MENU";
        $q->access_mode = "SInGLEPROJECT";
        $q->embedded_report = true;
        $q->user_parameters["lnumber"] =  $_POST['cmblnumber'];
        $q->execute();

My reportico query:

select 
    l_number, due_number, due_date, amount, capital, interest
from 
    loan_due
where
    l_number = "{USER_PARAM,lnumber}"
limit 
    0, 30