Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Access to a different column in the onCreate script
Access to a different column in the onCreate script [message #730454] Wed, 28 September 2011 12:49 Go to next message
Mike Wulkan is currently offline Mike WulkanFriend
Messages: 147
Registered: July 2009
Senior Member
Hi, I have a table that has columns as follows:

Type, Parameter, Value

for this example lets say the values for these columns are:

T, mirror_bypass_target, false

In the onCreate method of the Value column I have the code:
reportContext.setPersistentGlobalVariable("mirror_bypass_target",this.getValue());

This is to put the value into a global variable for use elsewhere in the report. Now I have many of these tables to deal with (each with a different Parameter name) so I'd like to make this script more generic so that I only have to specify "mirror_bypass_target" on the filter criteria for the table rather than both in the filter criteria and the script itself. I could do this if I could replace the literal value with a reference to the value of the Parameter column. Obviously the "this" context won't do here. Is there a way to achieve this?
Re: Access to a different column in the onCreate script [message #730550 is a reply to message #730454] Wed, 28 September 2011 15:35 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Mike,

Why not put it on the onCreate for the row and use

var pm = this.getRowData().getColumnValue("Parameter");
var val = this.getRowData().getColumnValue("Value");
reportContext.setPesistentGlobalVariable(pm, val);

BTW if you are not using this value in a chart you can just use
setGlobalVariable.

Jason

On 9/28/2011 8:49 AM, Mike Wulkan wrote:
> Hi, I have a table that has columns as follows:
>
> Type, Parameter, Value
>
> for this example lets say the values for these columns are:
>
> T, mirror_bypass_target, false
>
> In the onCreate method of the Value column I have the code:
> reportContext.setPersistentGlobalVariable("mirror_bypass_target",this.getValue());
>
>
> This is to put the value into a global variable for use elsewhere in the
> report. Now I have many of these tables to deal with (each with a
> different Parameter name) so I'd like to make this script more generic
> so that I only have to specify "mirror_bypass_target" on the filter
> criteria for the table rather than both in the filter criteria and the
> script itself. I could do this if I could replace the literal value with
> a reference to the value of the Parameter column. Obviously the "this"
> context won't do here. Is there a way to achieve this?
Previous Topic:Build an gantt chart: grouping data on Y-axis
Next Topic:How to control table size for PDF Generation?
Goto Forum:
  


Current Time: Fri Apr 19 16:24:12 GMT 2024

Powered by FUDForum. Page generated in 0.01630 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top