Skip to main content



      Home
Home » Archived » BIRT » .getExpressionValue("row[CUSTOMERNAME]" returns a NULL ! WHY?
.getExpressionValue("row[CUSTOMERNAME]" returns a NULL ! WHY? [message #992024] Thu, 20 December 2012 12:47 Go to next message
Eclipse UserFriend
Hi all,

I'm trying to count the CUSTOMER which name includes "Mini" so
I ' ve created a Table with the data item and coded:

onCreate :

row = this.getRowData();
CustName = row.getExpressionValue("row[CUSTOMERNAME]");
if( CustName.indexOf("Mini") = -1)
	count0Minis += 1;


And this is the Error Code:

The following items have errors:


Data (id = 110):
+ There are errors evaluating script "row = this.getRowData();

CustName = row.getExpressionValue("row[CUSTOMERNAME]");


if( CustName.indexOf("Mini") = -1)
count0Minis += 1;":

TypeError: Cannot call method "indexOf" of null (/report/body/table[@id="93"]/detail/row[@id="98"]/cell[@id="99"]/data[@id="110"]/method[@name="onCreate"]#6) (Element ID:11
0)


Why do I get a NULL as a return value if I use row.getExpressionValue??

Thanks,
Samet
Re: .getExpressionValue("row[CUSTOMERNAME]" returns a NULL ! WHY? [message #992053 is a reply to message #992024] Thu, 20 December 2012 14:04 Go to previous messageGo to next message
Eclipse UserFriend
Samet

Try:
this.getRowData().getColumnValue("CUSTOMERNAME");
BTW you know this can be done with an aggregation element that contains a filter expression. No code required.

Jason
Re: .getExpressionValue("row[CUSTOMERNAME]" returns a NULL ! WHY? [message #992269 is a reply to message #992053] Fri, 21 December 2012 03:52 Go to previous message
Eclipse UserFriend
Hey Jason,

Unfortunately I still get an error.
Thank you for the information to do it with an aggregation but I'm just trying to figure out how to work with BIRT.

Regards,
Samet

[Updated on: Fri, 21 December 2012 05:55] by Moderator

Previous Topic:DataEngine dataset cache
Next Topic:Adding an object to the application context! (Book example: Integrating and Extending)
Goto Forum:
  


Current Time: Mon Jul 07 08:57:43 EDT 2025

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

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

Back to the top