除了SQL查询中的Maximo参数之外,我还想添加一个动态参数。
像这样的东西:
select *
from workorder a
where params["where"] or a.parent = :Param
与params["where"]
与wonum ='1234'和:Param = '1234'
是否有可能与Birt获得巨额价值并将其也用于:Param
?
或者另一种方式?
谢谢
open是这样的(查询更复杂,所以我简化它):
maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());
maximoDataSet.open();
var sqlText = new String();
sqlText = "select column1, column2 as woParent, etc... from workorder where " + params["where"] + " or woParent=:param";
maximoDataSet.setQuery(sqlText);
beforeopen就是这样(只是为了查看查询):
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/birteaump.log", true ) );
out.println( "\nMy Query: " + this.queryText);
out.close();
我有一些代码要操作:param用wonum替换它,但this.queryText为null。我是birt报告的新手,也许我必须以不同的方式来解决我的问题。
谢谢
我用了Birt 3.7.1。我在视频中看到我们可以在数据集的对话框中添加查询。但是在我的报告中,当我使用“新数据集”按钮时,我只有“脚本数据集”。
我的查询在“beforeopen”与此相关时是否可能为空?
如果我创建另一种数据源,我将访问另一种数据集?
谢谢
好的,我解决了我的问题。我创建了一个JDBC数据源,并且可以访问一种新的数据集。我可以将我的查询放在这个数据集中,我可以访问“beforeopen”,我的查询不是null。
谢谢