Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » crosstab get aggregate value in javascript
crosstab get aggregate value in javascript [message #1014031] Mon, 25 February 2013 02:15 Go to next message
Sean Lewis is currently offline Sean LewisFriend
Messages: 8
Registered: February 2013
Junior Member
In my regular tables I have simple up/down arrow images and use a oncreate script to display an onhover helptext. IE :

this.helpText = "Revenue UP from last year : " + this.getRowData().getColumnValue("ly_revenue") + " $ ";


However I can't really find a way to do this when using a crosstab. I have the aggregate values in the crosstab, but if i try to refrence them the same as that I get :
Cannot call method "getColumnValue" of null

How can i reference a specific aggregate/summary item in the datacube/crosstab table through javascript?
Re: crosstab get aggregate value in javascript [message #1014304 is a reply to message #1014031] Mon, 25 February 2013 15:01 Go to previous messageGo to next message
Kristopher Clark is currently offline Kristopher ClarkFriend
Messages: 130
Registered: January 2013
Senior Member
Are you trying to set the help text of the crosstab or set the help text of another object using a value in the crosstab? If you're trying to set the help text of the crosstab you could use something like this in onCreate()

this.helpText = this.getValue();
Re: crosstab get aggregate value in javascript [message #1014465 is a reply to message #1014304] Mon, 25 February 2013 21:52 Go to previous messageGo to next message
Sean Lewis is currently offline Sean LewisFriend
Messages: 8
Registered: February 2013
Junior Member
I'm trying to set the helptext value of an image inside the crosstab. So each column/group in the crosstab has some up/down arrow images, i want a helptext/onhover for them that display a (hidden) value in the crosstab.

So i dont think this.getValue(); is going to work since the image i'm applying it to doesn't have a value.

I just dont know how to refer to a value in a crosstab, since it doesn't have the traditional table `this.getRowData().getColumnValue("some_value")` designation.

This is the first time I've played with crosstabs in Birt so excuse if this is a newbish question.
Re: crosstab get aggregate value in javascript [message #1018520 is a reply to message #1014465] Thu, 14 March 2013 01:32 Go to previous messageGo to next message
Sean Lewis is currently offline Sean LewisFriend
Messages: 8
Registered: February 2013
Junior Member
Just bumping to see if anyone has any ideas with this? I haven't had any luck figuring this out, yet I'm sure there's a real simple way to do it.
Re: crosstab get aggregate value in javascript [message #1020737 is a reply to message #1018520] Mon, 18 March 2013 20:49 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Can you attach a simple example showing what your setup is like? I'll take a look and try to help.

Michael

Developer Evangelist, Silanis
Re: crosstab get aggregate value in javascript [message #1020912 is a reply to message #1020737] Tue, 19 March 2013 06:55 Go to previous messageGo to next message
Sean Lewis is currently offline Sean LewisFriend
Messages: 8
Registered: February 2013
Junior Member
Thanks! As i was building the sample report I actually figured it out.

I've always used this.getRowData().getColumnValue() to get a value in an onCreate script for helptext.. However you don't need to, you can simply say "row". So either of these two examples work on a regular table :
this.helpText = "Revenue UP from last year : " + this.getRowData().getColumnValue("ly_revenue");

or
this.helpText = "Revenue UP from last year : " + row["ly_revenue"];


However only the latter one will work in a crosstab.

Much easier then the only other way idea I had, building some data element to figured the avlue and set it to a variable then call that in the oncreate script or build it in a html text element.

Thanks again

[Updated on: Tue, 19 March 2013 06:56]

Report message to a moderator

Re: crosstab get aggregate value in javascript [message #1021216 is a reply to message #1020912] Tue, 19 March 2013 17:17 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Great! Glad it's working! Let us know whenever you have questions!

Michael

Developer Evangelist, Silanis
Previous Topic:Bug in Crosstab Aggregation
Next Topic:Override event handler from external javascript file
Goto Forum:
  


Current Time: Thu Apr 18 08:18:17 GMT 2024

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

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

Back to the top