Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » .getExpressionValue("row[CUSTOMERNAME]" returns a NULL ! WHY?
.getExpressionValue("row[CUSTOMERNAME]" returns a NULL ! WHY? [message #992024] Thu, 20 December 2012 17:47 Go to next message
Samo B. is currently offline Samo B.
Messages: 41
Registered: December 2012
Member
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 19:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 08:52 Go to previous message
Samo B. is currently offline Samo B.
Messages: 41
Registered: December 2012
Member
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 10:55]

Report message to a moderator

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


Current Time: Fri Sep 19 09:52:07 GMT 2014

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

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