java JasperReports的scriptlet“beforeReportInit()”,它是做什么的?
我使用的是JasperReportsscriptlet-->;beforeReportInit()之前,我想在oracle数据库中调用一个存储过程,这样一个临时表将填充数据,然后我可以使用这些数据来填充报告
换句话说,我试图在参数表单触发器操作之后实现一些oracle报告。我该怎么做?我在这里错过了什么
/* before report is initialized */
public void beforeReportInit() throws JRScriptletException {
// gathering report connection
Connection conn = (Connection) this
.getParameterValue("REPORT_CONNECTION");
// calling stored procedure execution method.
boolean status = executeStoredProcedures(conn,
this.getParameterValue("P_NIC").toString(),
Integer.valueOf(this.getParameterValue("P_TYPE").toString()));
// if fails
if (!status) {
// setting the error on variable to display on the report
this.setVariableValue("ERROR_LOG", "PRE-REPORT TRIGGER FAILURE");
}
}
共 (0) 个答案