Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Assigning a variable to a specific data(data validation / data assignment)
Assigning a variable to a specific data [message #793226] Tue, 07 February 2012 22:43 Go to next message
andrew smith is currently offline andrew smith
Messages: 43
Registered: February 2012
Member
Hello,

Can BIRT assign a data point or a data array (obtained from SQL dataset) to a global variable that can be accessed throughout the report?

for example, suppose I have the following data set:
----------------
| NAME | VALUE |
----------------
|JOHN | 4 |
----------------
|MARY | 8 |
----------------
|KATE | 0 |
----------------

Can I assign a value of zero associated with 'KATE' programmatically (x = 0)?

Thanks in advance,
Re: Assigning a variable to a specific data [message #793408 is a reply to message #793226] Wed, 08 February 2012 04:43 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

There are a lot of ways to do this in BIRT. It can be done in Java or
JavaScript. You can event create and use a Java HashMap from JavaScript
events. In this case a simple javascript array will probably do what
you want. Have a look at the attached example. A hidden table is used
to fire an oncreate event that loads a js array which is then used by a
scripted data set for a second table.

Jason

On 2/7/2012 5:43 PM, andrew smith wrote:
> Hello,
> Can BIRT assign a data point or a data array (obtained from SQL dataset)
> to a global variable that can be accessed throughout the report?
>
> for example, suppose I have the following data set:
> ----------------
> | NAME | VALUE |
> ----------------
> |JOHN | 4 |
> ----------------
> |MARY | 8 |
> ----------------
> |KATE | 0 |
> ----------------
>
> Can I assign a value of zero associated with 'KATE' programmatically (x
> = 0)?
>
> Thanks in advance,
  • Attachment: jsarray.zip
    (Size: 2.72KB, Downloaded 125 times)
Previous Topic:How To Add Text To Group Header
Next Topic:birt view localization problem
Goto Forum:
  


Current Time: Thu Oct 23 17:10:27 GMT 2014

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

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