Skip to main content



      Home
Home » Archived » BIRT » computed column has errors in preview
computed column has errors in preview [message #198772] Thu, 02 November 2006 14:49 Go to next message
Eclipse UserFriend
Originally posted by: ndesai.applocation.net

Hi,

I have a computed column called minutes. When I run the "preview results"
it all works perfectly. However, when I run the full preview of the
report, all of a sudden I get an error saying: The data type of computed
column "minutes" is java.lang.Integer, but one of its value is "null",
which cannot be converted to java.lang.Integer.

Anyone know how I can fix this?

Neesha
Re: computed column has errors in preview [message #199083 is a reply to message #198772] Fri, 03 November 2006 16:00 Go to previous messageGo to next message
Eclipse UserFriend
Can you post the expression?
This is happening most likely becuase one of the fields is returning null.
You may want to put in your expression
if(row["mycol"]){
buildcomputed
}else{
0;
}


"Neesha" <ndesai@applocation.net> wrote in message
news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
> Hi,
>
> I have a computed column called minutes. When I run the "preview results"
> it all works perfectly. However, when I run the full preview of the
> report, all of a sudden I get an error saying: The data type of computed
> column "minutes" is java.lang.Integer, but one of its value is "null",
> which cannot be converted to java.lang.Integer.
> Anyone know how I can fix this?
>
> Neesha
>
Re: computed column has errors in preview [message #199107 is a reply to message #199083] Fri, 03 November 2006 16:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ndesai.applocation.net

Here's my computed column code:

if (row["details"].equalsIgnoreCase("STOP")) {
params["StopTime"] = row["reporttime"];
currentIsStart = false;
} else {
params["StartTime"] = row["reporttime"];
currentIsStart = true;
}

MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
params["StartTime"]);
params["StartTime"] = "01/01/2006 00:00:00 AM";

MinutesStopped

And this is the code used to display it in the report:

<VALUE-OF>if (row["Minutes"] > 60) {
hours = Math.floor(row["Minutes"] / 60);
mins = row["Minutes"] % 60;
result = hours + " minutes " + mins + " seconds";
} else {
result = row["Minutes"] + " seconds";
}

result</VALUE-OF>

(Yeah, I know it looks funny, but it was originaly hours and minutes, and
then got changed to mins and seconds and I haven't gone through and
changed the variable names. :))

Neesha

Jason Weathersby wrote:

> Can you post the expression?
> This is happening most likely becuase one of the fields is returning null.
> You may want to put in your expression
> if(row["mycol"]){
> buildcomputed
> }else{
> 0;
> }


> "Neesha" <ndesai@applocation.net> wrote in message
> news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
>> Hi,
>>
>> I have a computed column called minutes. When I run the "preview results"
>> it all works perfectly. However, when I run the full preview of the
>> report, all of a sudden I get an error saying: The data type of computed
>> column "minutes" is java.lang.Integer, but one of its value is "null",
>> which cannot be converted to java.lang.Integer.
>> Anyone know how I can fix this?
>>
>> Neesha
>>
Re: computed column has errors in preview [message #199301 is a reply to message #199107] Mon, 06 November 2006 11:59 Go to previous messageGo to next message
Eclipse UserFriend
You can do a check before you use the row values like
if ( row["details"] ){
if (row["details"].equalsIgnoreCase("STOP")) {
....

}

This should remove the nulls.

Jason

"Neesha" <ndesai@applocation.net> wrote in message
news:5cda25f925be7831cf98a1df765c3c79$1@www.eclipse.org...
> Here's my computed column code:
> if (row["details"].equalsIgnoreCase("STOP")) {
> params["StopTime"] = row["reporttime"];
> currentIsStart = false;
> } else {
> params["StartTime"] = row["reporttime"];
> currentIsStart = true;
> }
> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
> params["StartTime"]);
> params["StartTime"] = "01/01/2006 00:00:00 AM";
>
> MinutesStopped
>
> And this is the code used to display it in the report:
>
> <VALUE-OF>if (row["Minutes"] > 60) {
> hours = Math.floor(row["Minutes"] / 60);
> mins = row["Minutes"] % 60;
> result = hours + " minutes " + mins + " seconds";
> } else {
> result = row["Minutes"] + " seconds";
> }
>
> result</VALUE-OF>
>
> (Yeah, I know it looks funny, but it was originaly hours and minutes, and
> then got changed to mins and seconds and I haven't gone through and
> changed the variable names. :))
>
> Neesha
>
> Jason Weathersby wrote:
>
>> Can you post the expression?
>> This is happening most likely becuase one of the fields is returning
>> null.
>> You may want to put in your expression
>> if(row["mycol"]){
>> buildcomputed
>> }else{
>> 0;
>> }
>
>
>> "Neesha" <ndesai@applocation.net> wrote in message
>> news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
>>> Hi,
>>>
>>> I have a computed column called minutes. When I run the "preview
>>> results" it all works perfectly. However, when I run the full preview of
>>> the report, all of a sudden I get an error saying: The data type of
>>> computed column "minutes" is java.lang.Integer, but one of its value is
>>> "null", which cannot be converted to java.lang.Integer.
>>> Anyone know how I can fix this?
>>>
>>> Neesha
>>>
>
>
Re: computed column has errors in preview [message #199426 is a reply to message #199301] Mon, 06 November 2006 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ndesai.applocation.net

So I changed my code to the following, and I still get the same problem
when I try to preview the report.

if (row["details"] != null) {
if (row["details"].equalsIgnoreCase("STOP")) {
params["StopTime"] = row["reporttime"];
currentIsStart = false;
} else {
params["StartTime"] = row["reporttime"];
currentIsStart = true;
}

MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
params["StartTime"]);
params["StartTime"] = "01/01/2006 00:00:00 AM";

} else {
MinutesStopped = -2;
}

MinutesStopped

Neesha

Jason Weathersby wrote:

> You can do a check before you use the row values like
> if ( row["details"] ){
> if (row["details"].equalsIgnoreCase("STOP")) {
> ....

> }

> This should remove the nulls.

> Jason

> "Neesha" <ndesai@applocation.net> wrote in message
> news:5cda25f925be7831cf98a1df765c3c79$1@www.eclipse.org...
>> Here's my computed column code:
>> if (row["details"].equalsIgnoreCase("STOP")) {
>> params["StopTime"] = row["reporttime"];
>> currentIsStart = false;
>> } else {
>> params["StartTime"] = row["reporttime"];
>> currentIsStart = true;
>> }
>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>> params["StartTime"]);
>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>
>> MinutesStopped
>>
>> And this is the code used to display it in the report:
>>
>> <VALUE-OF>if (row["Minutes"] > 60) {
>> hours = Math.floor(row["Minutes"] / 60);
>> mins = row["Minutes"] % 60;
>> result = hours + " minutes " + mins + " seconds";
>> } else {
>> result = row["Minutes"] + " seconds";
>> }
>>
>> result</VALUE-OF>
>>
>> (Yeah, I know it looks funny, but it was originaly hours and minutes, and
>> then got changed to mins and seconds and I haven't gone through and
>> changed the variable names. :))
>>
>> Neesha
>>
>> Jason Weathersby wrote:
>>
>>> Can you post the expression?
>>> This is happening most likely becuase one of the fields is returning
>>> null.
>>> You may want to put in your expression
>>> if(row["mycol"]){
>>> buildcomputed
>>> }else{
>>> 0;
>>> }
>>
>>
>>> "Neesha" <ndesai@applocation.net> wrote in message
>>> news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
>>>> Hi,
>>>>
>>>> I have a computed column called minutes. When I run the "preview
>>>> results" it all works perfectly. However, when I run the full preview of
>>>> the report, all of a sudden I get an error saying: The data type of
>>>> computed column "minutes" is java.lang.Integer, but one of its value is
>>>> "null", which cannot be converted to java.lang.Integer.
>>>> Anyone know how I can fix this?
>>>>
>>>> Neesha
>>>>
>>
>>
Re: computed column has errors in preview [message #199516 is a reply to message #199426] Mon, 06 November 2006 19:53 Go to previous messageGo to next message
Eclipse UserFriend
Can you try
if (row["details"] ){

Also I would imagine the error is in something like
row["reporttime"];

So you may want to check it as well.

Jason

"Neesha" <ndesai@applocation.net> wrote in message
news:636df9d1ef9fbbd3832d9ac4cf037cff$1@www.eclipse.org...
> So I changed my code to the following, and I still get the same problem
> when I try to preview the report.
> if (row["details"] != null) {
> if (row["details"].equalsIgnoreCase("STOP")) {
> params["StopTime"] = row["reporttime"];
> currentIsStart = false;
> } else {
> params["StartTime"] = row["reporttime"];
> currentIsStart = true;
> }
> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
> params["StartTime"]);
> params["StartTime"] = "01/01/2006 00:00:00 AM";
>
> } else {
> MinutesStopped = -2;
> }
>
> MinutesStopped
>
> Neesha
>
> Jason Weathersby wrote:
>
>> You can do a check before you use the row values like
>> if ( row["details"] ){
>> if (row["details"].equalsIgnoreCase("STOP")) {
>> ....
>
>> }
>
>> This should remove the nulls.
>
>> Jason
>
>> "Neesha" <ndesai@applocation.net> wrote in message
>> news:5cda25f925be7831cf98a1df765c3c79$1@www.eclipse.org...
>>> Here's my computed column code:
>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>> params["StopTime"] = row["reporttime"];
>>> currentIsStart = false;
>>> } else {
>>> params["StartTime"] = row["reporttime"];
>>> currentIsStart = true;
>>> }
>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>> params["StartTime"]);
>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>
>>> MinutesStopped
>>>
>>> And this is the code used to display it in the report:
>>>
>>> <VALUE-OF>if (row["Minutes"] > 60) {
>>> hours = Math.floor(row["Minutes"] / 60);
>>> mins = row["Minutes"] % 60;
>>> result = hours + " minutes " + mins + " seconds";
>>> } else {
>>> result = row["Minutes"] + " seconds";
>>> }
>>>
>>> result</VALUE-OF>
>>>
>>> (Yeah, I know it looks funny, but it was originaly hours and minutes,
>>> and then got changed to mins and seconds and I haven't gone through and
>>> changed the variable names. :))
>>>
>>> Neesha
>>>
>>> Jason Weathersby wrote:
>>>
>>>> Can you post the expression?
>>>> This is happening most likely becuase one of the fields is returning
>>>> null.
>>>> You may want to put in your expression
>>>> if(row["mycol"]){
>>>> buildcomputed
>>>> }else{
>>>> 0;
>>>> }
>>>
>>>
>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>> news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
>>>>> Hi,
>>>>>
>>>>> I have a computed column called minutes. When I run the "preview
>>>>> results" it all works perfectly. However, when I run the full preview
>>>>> of the report, all of a sudden I get an error saying: The data type of
>>>>> computed column "minutes" is java.lang.Integer, but one of its value
>>>>> is "null", which cannot be converted to java.lang.Integer.
>>>>> Anyone know how I can fix this?
>>>>>
>>>>> Neesha
>>>>>
>>>
>>>
>
>
Re: computed column has errors in preview [message #199715 is a reply to message #199516] Tue, 07 November 2006 12:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ndesai.applocation.net

So I changed it to if (row["details"]) and it still didn't work. So then I
added in if (row["reporttime"]) and it still doesn't work. :(

Here's what my code looks like now.

if (row["details"]) {
if (row["reporttime"]) {
if (row["details"].equalsIgnoreCase("STOP")) {
params["StopTime"] = row["reporttime"];
currentIsStart = false;
} else {
params["StartTime"] = row["reporttime"];
currentIsStart = true;
}

MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
params["StartTime"]);
params["StartTime"] = "01/01/2006 00:00:00 AM";
} else {
MinutesStopped = -3;
}
} else {
MinutesStopped = -2;
}

MinutesStopped

Jason Weathersby wrote:

> Can you try
> if (row["details"] ){

> Also I would imagine the error is in something like
> row["reporttime"];

> So you may want to check it as well.

> Jason

> "Neesha" <ndesai@applocation.net> wrote in message
> news:636df9d1ef9fbbd3832d9ac4cf037cff$1@www.eclipse.org...
>> So I changed my code to the following, and I still get the same problem
>> when I try to preview the report.
>> if (row["details"] != null) {
>> if (row["details"].equalsIgnoreCase("STOP")) {
>> params["StopTime"] = row["reporttime"];
>> currentIsStart = false;
>> } else {
>> params["StartTime"] = row["reporttime"];
>> currentIsStart = true;
>> }
>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>> params["StartTime"]);
>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>
>> } else {
>> MinutesStopped = -2;
>> }
>>
>> MinutesStopped
>>
>> Neesha
>>
>> Jason Weathersby wrote:
>>
>>> You can do a check before you use the row values like
>>> if ( row["details"] ){
>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>> ....
>>
>>> }
>>
>>> This should remove the nulls.
>>
>>> Jason
>>
>>> "Neesha" <ndesai@applocation.net> wrote in message
>>> news:5cda25f925be7831cf98a1df765c3c79$1@www.eclipse.org...
>>>> Here's my computed column code:
>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>> params["StopTime"] = row["reporttime"];
>>>> currentIsStart = false;
>>>> } else {
>>>> params["StartTime"] = row["reporttime"];
>>>> currentIsStart = true;
>>>> }
>>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>>> params["StartTime"]);
>>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>>
>>>> MinutesStopped
>>>>
>>>> And this is the code used to display it in the report:
>>>>
>>>> <VALUE-OF>if (row["Minutes"] > 60) {
>>>> hours = Math.floor(row["Minutes"] / 60);
>>>> mins = row["Minutes"] % 60;
>>>> result = hours + " minutes " + mins + " seconds";
>>>> } else {
>>>> result = row["Minutes"] + " seconds";
>>>> }
>>>>
>>>> result</VALUE-OF>
>>>>
>>>> (Yeah, I know it looks funny, but it was originaly hours and minutes,
>>>> and then got changed to mins and seconds and I haven't gone through and
>>>> changed the variable names. :))
>>>>
>>>> Neesha
>>>>
>>>> Jason Weathersby wrote:
>>>>
>>>>> Can you post the expression?
>>>>> This is happening most likely becuase one of the fields is returning
>>>>> null.
>>>>> You may want to put in your expression
>>>>> if(row["mycol"]){
>>>>> buildcomputed
>>>>> }else{
>>>>> 0;
>>>>> }
>>>>
>>>>
>>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>>> news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
>>>>>> Hi,
>>>>>>
>>>>>> I have a computed column called minutes. When I run the "preview
>>>>>> results" it all works perfectly. However, when I run the full preview
>>>>>> of the report, all of a sudden I get an error saying: The data type of
>>>>>> computed column "minutes" is java.lang.Integer, but one of its value
>>>>>> is "null", which cannot be converted to java.lang.Integer.
>>>>>> Anyone know how I can fix this?
>>>>>>
>>>>>> Neesha
>>>>>>
>>>>
>>>>
>>
>>
Re: computed column has errors in preview [message #199738 is a reply to message #199715] Tue, 07 November 2006 13:54 Go to previous messageGo to next message
Eclipse UserFriend
Remember that an expression returns a value and it is always the last
statement you run, so
make sure the last statement has a value. It looks like you are using
MinutesStopped. Can you initialize that to 1?

Can you post your report?

Jason

"Neesha" <ndesai@applocation.net> wrote in message
news:184b5a5d1d05d5d52ca8808d2cc1851b$1@www.eclipse.org...
> So I changed it to if (row["details"]) and it still didn't work. So then I
> added in if (row["reporttime"]) and it still doesn't work. :(
>
> Here's what my code looks like now.
>
> if (row["details"]) {
> if (row["reporttime"]) {
> if (row["details"].equalsIgnoreCase("STOP")) {
> params["StopTime"] = row["reporttime"];
> currentIsStart = false;
> } else {
> params["StartTime"] = row["reporttime"];
> currentIsStart = true;
> }
> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
> params["StartTime"]);
> params["StartTime"] = "01/01/2006 00:00:00 AM";
> } else {
> MinutesStopped = -3;
> }
> } else {
> MinutesStopped = -2;
> }
>
> MinutesStopped
>
> Jason Weathersby wrote:
>
>> Can you try
>> if (row["details"] ){
>
>> Also I would imagine the error is in something like
>> row["reporttime"];
>
>> So you may want to check it as well.
>
>> Jason
>
>> "Neesha" <ndesai@applocation.net> wrote in message
>> news:636df9d1ef9fbbd3832d9ac4cf037cff$1@www.eclipse.org...
>>> So I changed my code to the following, and I still get the same problem
>>> when I try to preview the report.
>>> if (row["details"] != null) {
>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>> params["StopTime"] = row["reporttime"];
>>> currentIsStart = false;
>>> } else {
>>> params["StartTime"] = row["reporttime"];
>>> currentIsStart = true;
>>> }
>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>> params["StartTime"]);
>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>
>>> } else {
>>> MinutesStopped = -2;
>>> }
>>>
>>> MinutesStopped
>>>
>>> Neesha
>>>
>>> Jason Weathersby wrote:
>>>
>>>> You can do a check before you use the row values like
>>>> if ( row["details"] ){
>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>> ....
>>>
>>>> }
>>>
>>>> This should remove the nulls.
>>>
>>>> Jason
>>>
>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>> news:5cda25f925be7831cf98a1df765c3c79$1@www.eclipse.org...
>>>>> Here's my computed column code:
>>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>>> params["StopTime"] = row["reporttime"];
>>>>> currentIsStart = false;
>>>>> } else {
>>>>> params["StartTime"] = row["reporttime"];
>>>>> currentIsStart = true;
>>>>> }
>>>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>>>> params["StartTime"]);
>>>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>>>
>>>>> MinutesStopped
>>>>>
>>>>> And this is the code used to display it in the report:
>>>>>
>>>>> <VALUE-OF>if (row["Minutes"] > 60) {
>>>>> hours = Math.floor(row["Minutes"] / 60);
>>>>> mins = row["Minutes"] % 60;
>>>>> result = hours + " minutes " + mins + " seconds";
>>>>> } else {
>>>>> result = row["Minutes"] + " seconds";
>>>>> }
>>>>>
>>>>> result</VALUE-OF>
>>>>>
>>>>> (Yeah, I know it looks funny, but it was originaly hours and minutes,
>>>>> and then got changed to mins and seconds and I haven't gone through
>>>>> and changed the variable names. :))
>>>>>
>>>>> Neesha
>>>>>
>>>>> Jason Weathersby wrote:
>>>>>
>>>>>> Can you post the expression?
>>>>>> This is happening most likely becuase one of the fields is returning
>>>>>> null.
>>>>>> You may want to put in your expression
>>>>>> if(row["mycol"]){
>>>>>> buildcomputed
>>>>>> }else{
>>>>>> 0;
>>>>>> }
>>>>>
>>>>>
>>>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>>>> news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have a computed column called minutes. When I run the "preview
>>>>>>> results" it all works perfectly. However, when I run the full
>>>>>>> preview of the report, all of a sudden I get an error saying: The
>>>>>>> data type of computed column "minutes" is java.lang.Integer, but one
>>>>>>> of its value is "null", which cannot be converted to
>>>>>>> java.lang.Integer.
>>>>>>> Anyone know how I can fix this?
>>>>>>>
>>>>>>> Neesha
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Re: computed column has errors in preview [message #199762 is a reply to message #199738] Tue, 07 November 2006 17:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ndesai.applocation.net

Hi,

So I looked at it some more, and fiddled around and it still doesn't work.

I changed the expression I was using as I came up with a way better one
(easier to follow and actually works more in the way the last one was
intended to work).

Here it is:
MinutesStopped = -1;
if (row["details"] && row["reporttime"]) {
if (params["LastWasStop"] && row["details"].equalsIgnoreCase("START")) {
MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
row["reporttime"]);
params["LastWasStop"] = false;
} else if (row["details"].equalsIgnoreCase("START")) {
params["LastWasStop"] = false;
} else {
params["LastWasStop"] = true;
params["StopTime"] = row["reporttime"];
}
}
MinutesStopped

I can't post the report, but I could email it to you if you could tell me
your email address.

Neesha

Jason Weathersby wrote:

> Remember that an expression returns a value and it is always the last
> statement you run, so
> make sure the last statement has a value. It looks like you are using
> MinutesStopped. Can you initialize that to 1?

> Can you post your report?

> Jason

> "Neesha" <ndesai@applocation.net> wrote in message
> news:184b5a5d1d05d5d52ca8808d2cc1851b$1@www.eclipse.org...
>> So I changed it to if (row["details"]) and it still didn't work. So then I
>> added in if (row["reporttime"]) and it still doesn't work. :(
>>
>> Here's what my code looks like now.
>>
>> if (row["details"]) {
>> if (row["reporttime"]) {
>> if (row["details"].equalsIgnoreCase("STOP")) {
>> params["StopTime"] = row["reporttime"];
>> currentIsStart = false;
>> } else {
>> params["StartTime"] = row["reporttime"];
>> currentIsStart = true;
>> }
>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>> params["StartTime"]);
>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>> } else {
>> MinutesStopped = -3;
>> }
>> } else {
>> MinutesStopped = -2;
>> }
>>
>> MinutesStopped
>>
>> Jason Weathersby wrote:
>>
>>> Can you try
>>> if (row["details"] ){
>>
>>> Also I would imagine the error is in something like
>>> row["reporttime"];
>>
>>> So you may want to check it as well.
>>
>>> Jason
>>
>>> "Neesha" <ndesai@applocation.net> wrote in message
>>> news:636df9d1ef9fbbd3832d9ac4cf037cff$1@www.eclipse.org...
>>>> So I changed my code to the following, and I still get the same problem
>>>> when I try to preview the report.
>>>> if (row["details"] != null) {
>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>> params["StopTime"] = row["reporttime"];
>>>> currentIsStart = false;
>>>> } else {
>>>> params["StartTime"] = row["reporttime"];
>>>> currentIsStart = true;
>>>> }
>>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>>> params["StartTime"]);
>>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>>
>>>> } else {
>>>> MinutesStopped = -2;
>>>> }
>>>>
>>>> MinutesStopped
>>>>
>>>> Neesha
>>>>
>>>> Jason Weathersby wrote:
>>>>
>>>>> You can do a check before you use the row values like
>>>>> if ( row["details"] ){
>>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>>> ....
>>>>
>>>>> }
>>>>
>>>>> This should remove the nulls.
>>>>
>>>>> Jason
>>>>
>>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>>> news:5cda25f925be7831cf98a1df765c3c79$1@www.eclipse.org...
>>>>>> Here's my computed column code:
>>>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>>>> params["StopTime"] = row["reporttime"];
>>>>>> currentIsStart = false;
>>>>>> } else {
>>>>>> params["StartTime"] = row["reporttime"];
>>>>>> currentIsStart = true;
>>>>>> }
>>>>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>>>>> params["StartTime"]);
>>>>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>>>>
>>>>>> MinutesStopped
>>>>>>
>>>>>> And this is the code used to display it in the report:
>>>>>>
>>>>>> <VALUE-OF>if (row["Minutes"] > 60) {
>>>>>> hours = Math.floor(row["Minutes"] / 60);
>>>>>> mins = row["Minutes"] % 60;
>>>>>> result = hours + " minutes " + mins + " seconds";
>>>>>> } else {
>>>>>> result = row["Minutes"] + " seconds";
>>>>>> }
>>>>>>
>>>>>> result</VALUE-OF>
>>>>>>
>>>>>> (Yeah, I know it looks funny, but it was originaly hours and minutes,
>>>>>> and then got changed to mins and seconds and I haven't gone through
>>>>>> and changed the variable names. :))
>>>>>>
>>>>>> Neesha
>>>>>>
>>>>>> Jason Weathersby wrote:
>>>>>>
>>>>>>> Can you post the expression?
>>>>>>> This is happening most likely becuase one of the fields is returning
>>>>>>> null.
>>>>>>> You may want to put in your expression
>>>>>>> if(row["mycol"]){
>>>>>>> buildcomputed
>>>>>>> }else{
>>>>>>> 0;
>>>>>>> }
>>>>>>
>>>>>>
>>>>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>>>>> news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have a computed column called minutes. When I run the "preview
>>>>>>>> results" it all works perfectly. However, when I run the full
>>>>>>>> preview of the report, all of a sudden I get an error saying: The
>>>>>>>> data type of computed column "minutes" is java.lang.Integer, but one
>>>>>>>> of its value is "null", which cannot be converted to
>>>>>>>> java.lang.Integer.
>>>>>>>> Anyone know how I can fix this?
>>>>>>>>
>>>>>>>> Neesha
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Re: computed column has errors in preview [message #199817 is a reply to message #199762] Wed, 08 November 2006 06:22 Go to previous messageGo to next message
Eclipse UserFriend
Neesha,
This is a bug. Please see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=163786.

Thanks
Mingxia

"Neesha" <ndesai@applocation.net> wrote in message
news:a2381f68e81261568f4bafde11b79b9b$1@www.eclipse.org...
> Hi,
>
> So I looked at it some more, and fiddled around and it still doesn't work.
> I changed the expression I was using as I came up with a way better one
> (easier to follow and actually works more in the way the last one was
> intended to work).
> Here it is: MinutesStopped = -1;
> if (row["details"] && row["reporttime"]) {
> if (params["LastWasStop"] && row["details"].equalsIgnoreCase("START")) {
> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
> row["reporttime"]);
> params["LastWasStop"] = false;
> } else if (row["details"].equalsIgnoreCase("START")) {
> params["LastWasStop"] = false;
> } else { params["LastWasStop"] = true;
> params["StopTime"] = row["reporttime"];
> }
> }
> MinutesStopped
>
> I can't post the report, but I could email it to you if you could tell me
> your email address.
> Neesha
>
> Jason Weathersby wrote:
>
>> Remember that an expression returns a value and it is always the last
>> statement you run, so
>> make sure the last statement has a value. It looks like you are using
>> MinutesStopped. Can you initialize that to 1?
>
>> Can you post your report?
>
>> Jason
>
>> "Neesha" <ndesai@applocation.net> wrote in message
>> news:184b5a5d1d05d5d52ca8808d2cc1851b$1@www.eclipse.org...
>>> So I changed it to if (row["details"]) and it still didn't work. So then
>>> I added in if (row["reporttime"]) and it still doesn't work. :(
>>>
>>> Here's what my code looks like now.
>>>
>>> if (row["details"]) {
>>> if (row["reporttime"]) {
>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>> params["StopTime"] = row["reporttime"];
>>> currentIsStart = false;
>>> } else {
>>> params["StartTime"] = row["reporttime"];
>>> currentIsStart = true;
>>> }
>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>> params["StartTime"]);
>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>> } else {
>>> MinutesStopped = -3;
>>> }
>>> } else {
>>> MinutesStopped = -2;
>>> }
>>>
>>> MinutesStopped
>>>
>>> Jason Weathersby wrote:
>>>
>>>> Can you try
>>>> if (row["details"] ){
>>>
>>>> Also I would imagine the error is in something like
>>>> row["reporttime"];
>>>
>>>> So you may want to check it as well.
>>>
>>>> Jason
>>>
>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>> news:636df9d1ef9fbbd3832d9ac4cf037cff$1@www.eclipse.org...
>>>>> So I changed my code to the following, and I still get the same
>>>>> problem when I try to preview the report.
>>>>> if (row["details"] != null) {
>>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>>> params["StopTime"] = row["reporttime"];
>>>>> currentIsStart = false;
>>>>> } else {
>>>>> params["StartTime"] = row["reporttime"];
>>>>> currentIsStart = true;
>>>>> }
>>>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>>>> params["StartTime"]);
>>>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>>>
>>>>> } else {
>>>>> MinutesStopped = -2;
>>>>> }
>>>>>
>>>>> MinutesStopped
>>>>>
>>>>> Neesha
>>>>>
>>>>> Jason Weathersby wrote:
>>>>>
>>>>>> You can do a check before you use the row values like
>>>>>> if ( row["details"] ){
>>>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>>>> ....
>>>>>
>>>>>> }
>>>>>
>>>>>> This should remove the nulls.
>>>>>
>>>>>> Jason
>>>>>
>>>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>>>> news:5cda25f925be7831cf98a1df765c3c79$1@www.eclipse.org...
>>>>>>> Here's my computed column code:
>>>>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>>>>> params["StopTime"] = row["reporttime"];
>>>>>>> currentIsStart = false;
>>>>>>> } else {
>>>>>>> params["StartTime"] = row["reporttime"];
>>>>>>> currentIsStart = true;
>>>>>>> }
>>>>>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>>>>>> params["StartTime"]);
>>>>>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>>>>>
>>>>>>> MinutesStopped
>>>>>>>
>>>>>>> And this is the code used to display it in the report:
>>>>>>>
>>>>>>> <VALUE-OF>if (row["Minutes"] > 60) {
>>>>>>> hours = Math.floor(row["Minutes"] / 60);
>>>>>>> mins = row["Minutes"] % 60;
>>>>>>> result = hours + " minutes " + mins + " seconds";
>>>>>>> } else {
>>>>>>> result = row["Minutes"] + " seconds";
>>>>>>> }
>>>>>>>
>>>>>>> result</VALUE-OF>
>>>>>>>
>>>>>>> (Yeah, I know it looks funny, but it was originaly hours and
>>>>>>> minutes, and then got changed to mins and seconds and I haven't gone
>>>>>>> through and changed the variable names. :))
>>>>>>>
>>>>>>> Neesha
>>>>>>>
>>>>>>> Jason Weathersby wrote:
>>>>>>>
>>>>>>>> Can you post the expression?
>>>>>>>> This is happening most likely becuase one of the fields is
>>>>>>>> returning null.
>>>>>>>> You may want to put in your expression
>>>>>>>> if(row["mycol"]){
>>>>>>>> buildcomputed
>>>>>>>> }else{
>>>>>>>> 0;
>>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>>>>>> news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I have a computed column called minutes. When I run the "preview
>>>>>>>>> results" it all works perfectly. However, when I run the full
>>>>>>>>> preview of the report, all of a sudden I get an error saying: The
>>>>>>>>> data type of computed column "minutes" is java.lang.Integer, but
>>>>>>>>> one of its value is "null", which cannot be converted to
>>>>>>>>> java.lang.Integer.
>>>>>>>>> Anyone know how I can fix this?
>>>>>>>>>
>>>>>>>>> Neesha
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Re: computed column has errors in preview [message #199897 is a reply to message #199817] Wed, 08 November 2006 17:25 Go to previous message
Eclipse UserFriend
Originally posted by: ndesai.applocation.net

Hmm... I don't suppose there's anyway around this bug? Certain types of
things I need to leave out of the expression so it would work?

Neesha

mwu wrote:

> Neesha,
> This is a bug. Please see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=163786.

> Thanks
> Mingxia

> "Neesha" <ndesai@applocation.net> wrote in message
> news:a2381f68e81261568f4bafde11b79b9b$1@www.eclipse.org...
>> Hi,
>>
>> So I looked at it some more, and fiddled around and it still doesn't work.
>> I changed the expression I was using as I came up with a way better one
>> (easier to follow and actually works more in the way the last one was
>> intended to work).
>> Here it is: MinutesStopped = -1;
>> if (row["details"] && row["reporttime"]) {
>> if (params["LastWasStop"] && row["details"].equalsIgnoreCase("START")) {
>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>> row["reporttime"]);
>> params["LastWasStop"] = false;
>> } else if (row["details"].equalsIgnoreCase("START")) {
>> params["LastWasStop"] = false;
>> } else { params["LastWasStop"] = true;
>> params["StopTime"] = row["reporttime"];
>> }
>> }
>> MinutesStopped
>>
>> I can't post the report, but I could email it to you if you could tell me
>> your email address.
>> Neesha
>>
>> Jason Weathersby wrote:
>>
>>> Remember that an expression returns a value and it is always the last
>>> statement you run, so
>>> make sure the last statement has a value. It looks like you are using
>>> MinutesStopped. Can you initialize that to 1?
>>
>>> Can you post your report?
>>
>>> Jason
>>
>>> "Neesha" <ndesai@applocation.net> wrote in message
>>> news:184b5a5d1d05d5d52ca8808d2cc1851b$1@www.eclipse.org...
>>>> So I changed it to if (row["details"]) and it still didn't work. So then
>>>> I added in if (row["reporttime"]) and it still doesn't work. :(
>>>>
>>>> Here's what my code looks like now.
>>>>
>>>> if (row["details"]) {
>>>> if (row["reporttime"]) {
>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>> params["StopTime"] = row["reporttime"];
>>>> currentIsStart = false;
>>>> } else {
>>>> params["StartTime"] = row["reporttime"];
>>>> currentIsStart = true;
>>>> }
>>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>>> params["StartTime"]);
>>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>> } else {
>>>> MinutesStopped = -3;
>>>> }
>>>> } else {
>>>> MinutesStopped = -2;
>>>> }
>>>>
>>>> MinutesStopped
>>>>
>>>> Jason Weathersby wrote:
>>>>
>>>>> Can you try
>>>>> if (row["details"] ){
>>>>
>>>>> Also I would imagine the error is in something like
>>>>> row["reporttime"];
>>>>
>>>>> So you may want to check it as well.
>>>>
>>>>> Jason
>>>>
>>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>>> news:636df9d1ef9fbbd3832d9ac4cf037cff$1@www.eclipse.org...
>>>>>> So I changed my code to the following, and I still get the same
>>>>>> problem when I try to preview the report.
>>>>>> if (row["details"] != null) {
>>>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>>>> params["StopTime"] = row["reporttime"];
>>>>>> currentIsStart = false;
>>>>>> } else {
>>>>>> params["StartTime"] = row["reporttime"];
>>>>>> currentIsStart = true;
>>>>>> }
>>>>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>>>>> params["StartTime"]);
>>>>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>>>>
>>>>>> } else {
>>>>>> MinutesStopped = -2;
>>>>>> }
>>>>>>
>>>>>> MinutesStopped
>>>>>>
>>>>>> Neesha
>>>>>>
>>>>>> Jason Weathersby wrote:
>>>>>>
>>>>>>> You can do a check before you use the row values like
>>>>>>> if ( row["details"] ){
>>>>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>>>>> ....
>>>>>>
>>>>>>> }
>>>>>>
>>>>>>> This should remove the nulls.
>>>>>>
>>>>>>> Jason
>>>>>>
>>>>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>>>>> news:5cda25f925be7831cf98a1df765c3c79$1@www.eclipse.org...
>>>>>>>> Here's my computed column code:
>>>>>>>> if (row["details"].equalsIgnoreCase("STOP")) {
>>>>>>>> params["StopTime"] = row["reporttime"];
>>>>>>>> currentIsStart = false;
>>>>>>>> } else {
>>>>>>>> params["StartTime"] = row["reporttime"];
>>>>>>>> currentIsStart = true;
>>>>>>>> }
>>>>>>>> MinutesStopped = DateTimeSpan.seconds(params["StopTime"],
>>>>>>>> params["StartTime"]);
>>>>>>>> params["StartTime"] = "01/01/2006 00:00:00 AM";
>>>>>>>>
>>>>>>>> MinutesStopped
>>>>>>>>
>>>>>>>> And this is the code used to display it in the report:
>>>>>>>>
>>>>>>>> <VALUE-OF>if (row["Minutes"] > 60) {
>>>>>>>> hours = Math.floor(row["Minutes"] / 60);
>>>>>>>> mins = row["Minutes"] % 60;
>>>>>>>> result = hours + " minutes " + mins + " seconds";
>>>>>>>> } else {
>>>>>>>> result = row["Minutes"] + " seconds";
>>>>>>>> }
>>>>>>>>
>>>>>>>> result</VALUE-OF>
>>>>>>>>
>>>>>>>> (Yeah, I know it looks funny, but it was originaly hours and
>>>>>>>> minutes, and then got changed to mins and seconds and I haven't gone
>>>>>>>> through and changed the variable names. :))
>>>>>>>>
>>>>>>>> Neesha
>>>>>>>>
>>>>>>>> Jason Weathersby wrote:
>>>>>>>>
>>>>>>>>> Can you post the expression?
>>>>>>>>> This is happening most likely becuase one of the fields is
>>>>>>>>> returning null.
>>>>>>>>> You may want to put in your expression
>>>>>>>>> if(row["mycol"]){
>>>>>>>>> buildcomputed
>>>>>>>>> }else{
>>>>>>>>> 0;
>>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>>> "Neesha" <ndesai@applocation.net> wrote in message
>>>>>>>>> news:6c41140eba441a69cca4c43dd5d934f2$1@www.eclipse.org...
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I have a computed column called minutes. When I run the "preview
>>>>>>>>>> results" it all works perfectly. However, when I run the full
>>>>>>>>>> preview of the report, all of a sudden I get an error saying: The
>>>>>>>>>> data type of computed column "minutes" is java.lang.Integer, but
>>>>>>>>>> one of its value is "null", which cannot be converted to
>>>>>>>>>> java.lang.Integer.
>>>>>>>>>> Anyone know how I can fix this?
>>>>>>>>>>
>>>>>>>>>> Neesha
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Previous Topic:newsgroup for Jasper?
Next Topic:Adding a wiki page?
Goto Forum:
  


Current Time: Mon Sep 15 05:51:49 EDT 2025

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

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

Back to the top