Skip to main content



      Home
Home » Archived » BIRT » Birt Exception in Computed Column
Birt Exception in Computed Column [message #259274] Wed, 24 October 2007 08:42 Go to next message
Eclipse UserFriend
Hi,

I'm trying to create a Computed Column to show a formula depending on it's
tipe:

if( row["TIPO_REGRESION"] == "POL" ) {
row["A"] + " + " row["B"] + "x" + " + " row["C"] + "x^2"
} else if( row["TIPO_REGRESION"] == "LIN" ) {
row["A"] + " + " row["B"] + "x"
} else if( row["TIPO_REGRESION"] == "EXP" ) {
row["A"] + " + " row["C"] + "x^2"
} else if( row["TIPO_REGRESION"] == "POT" ) {
row["M"] + "x^" + row["N"]
}

but get an exception making a preview:

A BIRT exception occurred.
Plug-in Provider:Eclipse.org
Plug-in Name:BIRT Data Engine
Plug-in ID:org.eclipse.birt.data
Version:2.2.0.v200706221
Error Code:data.engine.BirtException
Error Message:A BIRT exception occurred: org.eclipse.birt.core. See next
exception for more information.
org.eclipse.birt.core

Is there anything wrong with the JS code?

Regads,
Eduardo.
Re: Birt Exception in Computed Column [message #259308 is a reply to message #259274] Wed, 24 October 2007 11:39 Go to previous messageGo to next message
Eclipse UserFriend
Eduardo,

I don't really know what you want your expression to look like, but it appears
you are missing an addition sign (+) between your literal " + " value in
the string.

You don't need to create the variable, but it removes a bunch of double quotes
and makes it a bit easier to read:

var add = " + ";

if( row["TIPO_REGRESION"] == "POL" ) {
row["A"] + add + row["B"] + "x" + add + row["C"] + "x^2"
} else if( row["TIPO_REGRESION"] == "LIN" ) {
row["A"] + add + row["B"] + "x"
} else if( row["TIPO_REGRESION"] == "EXP" ) {
row["A"] + add + row["C"] + "x^2"
} else if( row["TIPO_REGRESION"] == "POT" ) {
row["M"] + "x^" + row["N"]
}


Scott Rosenbaum

> Hi,
>
> I'm trying to create a Computed Column to show a formula depending on
> it's tipe:
>
> if( row["TIPO_REGRESION"] == "POL" ) {
> row["A"] + " + " row["B"] + "x" + " + " row["C"] + "x^2"
> } else if( row["TIPO_REGRESION"] == "LIN" ) {
> row["A"] + " + " row["B"] + "x"
> } else if( row["TIPO_REGRESION"] == "EXP" ) {
> row["A"] + " + " row["C"] + "x^2"
> } else if( row["TIPO_REGRESION"] == "POT" ) {
> row["M"] + "x^" + row["N"]
> }
> but get an exception making a preview:
>
> A BIRT exception occurred.
> Plug-in Provider:Eclipse.org
> Plug-in Name:BIRT Data Engine
> Plug-in ID:org.eclipse.birt.data
> Version:2.2.0.v200706221
> Error Code:data.engine.BirtException
> Error Message:A BIRT exception occurred: org.eclipse.birt.core. See
> next
> exception for more information.
> org.eclipse.birt.core
> Is there anything wrong with the JS code?
>
> Regads,
> Eduardo.
Re: Birt Exception in Computed Column [message #259339 is a reply to message #259308] Wed, 24 October 2007 13:56 Go to previous message
Eclipse UserFriend
Scott,

You're totally right, it worked like a charm.

Lots of thanks.

"Scott Rosenbaum" <scottr@innoventsolutions.com> escribi
Previous Topic:Compatibility between Multi select List Boxes and Drill-Throughs
Next Topic:Show TOC automatically when report start
Goto Forum:
  


Current Time: Wed May 07 14:25:39 EDT 2025

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

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

Back to the top