请帮我通过PHP代码将报告参数传递给“Reportica报告”。
这是我尝试过的方法:
PHP代码:
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);
报告查询:
SELECT l_number,due_number,due_date,amount,capital,interest
FROM loan_due
WHERE l_number = {external_param1}
错误讯息:
错误:连接中的错误(1064):您的SQL语法中有错误;检查与MySQL服务器版本对应的手册,以便在第3行附近的'})'附近使用正确的语法
答案 0 :(得分:1)
我的剧本:
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();
我的reportico查询:
select
l_number, due_number, due_date, amount, capital, interest
from
loan_due
where
l_number = "{USER_PARAM,lnumber}"
limit
0, 30