Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Access the value of a computed column of a dataset in a script
Access the value of a computed column of a dataset in a script [message #900740] Wed, 08 August 2012 11:11 Go to next message
Rupal Biyani is currently offline Rupal BiyaniFriend
Messages: 8
Registered: July 2012
Junior Member
Hi,

I have added a data element to one of the column of the grid.In the onRender script of the data element , i want to access the value of a computed column of a particular datset.
I tried doing something like this:
temp=reportContext.getDesignHandle().findDataSet("Design Defects Not found in Design Phase").computedColumnsIterator().next();
this.setDisplayValue(temp);

But this script only fetches me the object, not the value.

Can you please help me on how to access the value of a computed data column from the script.

Thanks!
Rupal
Re: Access the value of a computed column of a dataset in a script [message #900818 is a reply to message #900740] Wed, 08 August 2012 15:33 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

That iterator will only get you the design not the values. Is you data
item bound to a dataset or is the grid? In either case add the computed
column to the binding and just reference it like:

this.setDisplayValue(this.getRowData().getColumnValue("COMPUTEDCOLUMNBINDINGNAME"));

See attached example

Jason

On 8/8/2012 7:11 AM, Rupal Biyani wrote:
> Hi,
>
> I have added a data element to one of the column of the grid.In the
> onRender script of the data element , i want to access the value of a
> computed column of a particular datset.
> I tried doing something like this:
> temp=reportContext.getDesignHandle().findDataSet("Design Defects Not
> found in Design Phase").computedColumnsIterator().next();
> this.setDisplayValue(temp);
>
> But this script only fetches me the object, not the value.
>
> Can you please help me on how to access the value of a computed data
> column from the script.
>
> Thanks!
> Rupal
Re: Access the value of a computed column of a dataset in a script [message #901148 is a reply to message #900818] Fri, 10 August 2012 05:26 Go to previous messageGo to next message
Rupal Biyani is currently offline Rupal BiyaniFriend
Messages: 8
Registered: July 2012
Junior Member
Jason Weathersby wrote on Wed, 08 August 2012 11:33
That iterator will only get you the design not the values. Is you data
item bound to a dataset or is the grid? In either case add the computed
column to the binding and just reference it like:

this.setDisplayValue(this.getRowData().getColumnValue("COMPUTEDCOLUMNBINDINGNAME"));

See attached example

Jason

On 8/8/2012 7:11 AM, Rupal Biyani wrote:
> Hi,
>
> I have added a data element to one of the column of the grid.In the
> onRender script of the data element , i want to access the value of a
> computed column of a particular datset.
> I tried doing something like this:
> temp=reportContext.getDesignHandle().findDataSet("Design Defects Not
> found in Design Phase").computedColumnsIterator().next();
> this.setDisplayValue(temp);
>
> But this script only fetches me the object, not the value.
>
> Can you please help me on how to access the value of a computed data
> column from the script.
>
> Thanks!
> Rupal


Jason,

My requirement is as follows:

I need to display the values of various project metrics in a grid.
This project metric is a ratio,where the numerator and denominator comes from two different data sets.But since we can attach, only one datset to an element.I cannot calculate the ratio.
Right now i have made a invisible grid with many tables, that stores the values of these numerators and denominators and then in the final grid using OnRender script, i calculate the values.

I wanted to ask is there any other way through which we can do this?
I am attaching the file for your reference.
Re: Access the value of a computed column of a dataset in a script [message #901613 is a reply to message #901148] Mon, 13 August 2012 16:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Yes but first do the datasets return more than one row?

Jason

On 8/10/2012 1:26 AM, Rupal Biyani wrote:
> Jason Weathersby wrote on Wed, 08 August 2012 11:33
>> That iterator will only get you the design not the values. Is you data
>> item bound to a dataset or is the grid? In either case add the computed
>> column to the binding and just reference it like:
>>
>> this.setDisplayValue(this.getRowData().getColumnValue("COMPUTEDCOLUMNBINDINGNAME"));
>>
>> See attached example
>>
>> Jason
>>
>> On 8/8/2012 7:11 AM, Rupal Biyani wrote:
>>> Hi,
>>>
>>> I have added a data element to one of the column of the grid.In the
>>> onRender script of the data element , i want to access the value of a
>>> computed column of a particular datset.
>>> I tried doing something like this:
>>> temp=reportContext.getDesignHandle().findDataSet("Design Defects Not
>>> found in Design Phase").computedColumnsIterator().next();
>>> this.setDisplayValue(temp);
>>>
>>> But this script only fetches me the object, not the value.
>>>
>>> Can you please help me on how to access the value of a computed data
>>> column from the script.
>>>
>>> Thanks!
>>> Rupal
>
>
> Jason,
>
> My requirement is as follows:
>
> I need to display the values of various project metrics in a grid.
> This project metric is a ratio,where the numerator and denominator comes from two different data sets.But since we can attach, only one datset to an element.I cannot calculate the ratio.
> Right now i have made a invisible grid with many tables, that stores the values of these numerators and denominators and then in the final grid using OnRender script, i calculate the values.
>
> I wanted to ask is there any other way through which we can do this?
> I am attaching the file for your reference.
>
Re: Access the value of a computed column of a dataset in a script [message #901616 is a reply to message #901613] Mon, 13 August 2012 16:27 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can always bind one dataset to the grid and one to the data item and
then reference the outer one within the data expression. See attached.

Jason

On 8/13/2012 12:22 PM, Jason Weathersby wrote:
> Yes but first do the datasets return more than one row?
>
> Jason
>
> On 8/10/2012 1:26 AM, Rupal Biyani wrote:
>> Jason Weathersby wrote on Wed, 08 August 2012 11:33
>>> That iterator will only get you the design not the values. Is you data
>>> item bound to a dataset or is the grid? In either case add the computed
>>> column to the binding and just reference it like:
>>>
>>> this.setDisplayValue(this.getRowData().getColumnValue("COMPUTEDCOLUMNBINDINGNAME"));
>>>
>>>
>>> See attached example
>>>
>>> Jason
>>>
>>> On 8/8/2012 7:11 AM, Rupal Biyani wrote:
>>>> Hi,
>>>>
>>>> I have added a data element to one of the column of the grid.In the
>>>> onRender script of the data element , i want to access the value of a
>>>> computed column of a particular datset.
>>>> I tried doing something like this:
>>>> temp=reportContext.getDesignHandle().findDataSet("Design Defects Not
>>>> found in Design Phase").computedColumnsIterator().next();
>>>> this.setDisplayValue(temp);
>>>>
>>>> But this script only fetches me the object, not the value.
>>>>
>>>> Can you please help me on how to access the value of a computed data
>>>> column from the script.
>>>>
>>>> Thanks!
>>>> Rupal
>>
>>
>> Jason,
>>
>> My requirement is as follows:
>>
>> I need to display the values of various project metrics in a grid.
>> This project metric is a ratio,where the numerator and denominator
>> comes from two different data sets.But since we can attach, only one
>> datset to an element.I cannot calculate the ratio.
>> Right now i have made a invisible grid with many tables, that stores
>> the values of these numerators and denominators and then in the final
>> grid using OnRender script, i calculate the values.
>>
>> I wanted to ask is there any other way through which we can do this?
>> I am attaching the file for your reference.
>>
>
Previous Topic:Birt POJO's as DataSource?
Next Topic:Print Report --> Empty page
Goto Forum:
  


Current Time: Sat Apr 20 04:45:31 GMT 2024

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

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

Back to the top