简体   繁体   English

在BIRT报表中设置页面变量

[英]Set page variable in BIRT report

I have a BIRT report I'm calling with a report engine in GWT. 我有一个用GWT中的报告引擎调用的BIRT报告。 I can set a report parameter with 我可以使用设置参数

task.setParameterValue("orderNumber", orderNum);

But how can I set a report variable value? 但是,如何设置报告变量值? I don't see anything in the API for setting one and I'm at a loss. 我在API中看不到用于设置一个的任何内容,我很茫然。 thanks. 谢谢。

You can't, a variable is internal in a report, otherwise it is a parameter. 您不能,变量是报表中的内部变量,否则它是参数。 A workaround would be to initialize your report variable from a parameter: set the default value of the variable as "javascript expression" and just drag&drop a parameter. 一种解决方法是从参数初始化报表变量:将变量的默认值设置为“ javascript表达式”,然后只需拖放一个参数即可。 It will create an expression such 它将创建一个这样的表达式

params["myParamVariable"].value

We can then use the report engine API to set the value of "myParamVariable" 然后,我们可以使用报表引擎API设置“ myParamVariable”的值

您必须在Birt引擎的数据资源管理器中的报表参数中添加相同名称的参数,然后才能使用params["orderNum"].value

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM