Skip to main content



      Home
Home » Archived » BIRT » crosstab get aggregate value in javascript
crosstab get aggregate value in javascript [message #1014031] Sun, 24 February 2013 21:15 Go to next message
Eclipse UserFriend
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 10:01 Go to previous messageGo to next message
Eclipse UserFriend
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 16:52 Go to previous messageGo to next message
Eclipse UserFriend
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] Wed, 13 March 2013 21:32 Go to previous messageGo to next message
Eclipse UserFriend
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 16:49 Go to previous messageGo to next message
Eclipse UserFriend
Can you attach a simple example showing what your setup is like? I'll take a look and try to help.
Re: crosstab get aggregate value in javascript [message #1020912 is a reply to message #1020737] Tue, 19 March 2013 02:55 Go to previous messageGo to next message
Eclipse UserFriend
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 02:56] by Moderator

Re: crosstab get aggregate value in javascript [message #1021216 is a reply to message #1020912] Tue, 19 March 2013 13:17 Go to previous message
Eclipse UserFriend
Great! Glad it's working! Let us know whenever you have questions!
Previous Topic:Bug in Crosstab Aggregation
Next Topic:Override event handler from external javascript file
Goto Forum:
  


Current Time: Mon Apr 21 05:10:58 EDT 2025

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

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

Back to the top