BIRT Variable - How to create and use?

Lucas Silva de Freitas picture Lucas Silva de Freitas · Nov 4, 2013 · Viewed 15.1k times · Source

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.

Someone can explain me how I can do it ?

Answer

Dominique picture Dominique · Nov 4, 2013

We initialize a global report variable in "Variables" section of the outline view:

Global variable

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.