Java BIRT 变量 - 如何创建和使用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19765715/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
BIRT Variable - How to create and use?
提问by Lucas Silva de Freitas
I need to create a global report variable to get a variable of my first table, then use it in my last table to do a calculation.
我需要创建一个全局报告变量来获取我的第一个表的变量,然后在我的最后一个表中使用它来进行计算。
I'm new with BIRT and don't found a guide to do it.
我是 BIRT 的新手,没有找到做这件事的指南。
Someone can explain me how I can do it ?
有人可以解释我该怎么做吗?
采纳答案by Dominique
We initialize a global report variable in "Variables" section of the outline view:
我们在大纲视图的“变量”部分初始化一个全局报表变量:
Then we can set and get its value from any place of the report:
然后我们可以从报表的任何地方设置和获取它的值:
myvalue=vars["myGlobalVariable"];
vars["myGlobalVariable"]=myvalue;
Notice global variables we declare like this are also available in the expression builder, which is very convenient.
注意我们这样声明的全局变量也可以在表达式生成器中使用,非常方便。