Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » question on howto change the row background based on table data
question on howto change the row background based on table data [message #76430] Thu, 22 September 2005 14:55 Go to next message
James Norris is currently offline James NorrisFriend
Messages: 52
Registered: July 2009
Member
I would like to be able to change the background color for a row in a table
based on the value of some of the items in the row. If someone could tell
me if this is possible and how to accomplish it I'd appreciate it.

Thanks,
Jim
Re: question on howto change the row background based on table data [message #76530 is a reply to message #76430] Thu, 22 September 2005 15:34 Go to previous messageGo to next message
James Norris is currently offline James NorrisFriend
Messages: 52
Registered: July 2009
Member
Found this answer in a previous post from Jason Weathersby and it works for
me:

Select the fields in the row and choose the highlights tab under the
Property
Editor. Add a condition for the highlight and set the background color.

-Jim

"jnorris" <james.norris@pb.com> wrote in message
news:dgugk5$a75$1@news.eclipse.org...
>I would like to be able to change the background color for a row in a table
>based on the value of some of the items in the row. If someone could tell
>me if this is possible and how to accomplish it I'd appreciate it.
>
> Thanks,
> Jim
>
Re: question on howto change the row background based on table data [message #76560 is a reply to message #76530] Thu, 22 September 2005 15:54 Go to previous messageGo to next message
James Norris is currently offline James NorrisFriend
Messages: 52
Registered: July 2009
Member
Actually this doesn't work correctly after all. I have two conditions set
to highlight the first column in the report based on comparing values of two
columns from the dataset. In the designer preview it works as expected.
However, when I run the application using the same dataset I am getting two
rows in the report table for each row in the dataset with the second row
being highlighted when it shouldn't be.

Any ideas?

Thanks,
Jim

"jnorris" <james.norris@pb.com> wrote in message
news:dguitu$dls$1@news.eclipse.org...
> Found this answer in a previous post from Jason Weathersby and it works
> for me:
>
> Select the fields in the row and choose the highlights tab under the
> Property
> Editor. Add a condition for the highlight and set the background color.
>
> -Jim
>
> "jnorris" <james.norris@pb.com> wrote in message
> news:dgugk5$a75$1@news.eclipse.org...
>>I would like to be able to change the background color for a row in a
>>table based on the value of some of the items in the row. If someone
>>could tell me if this is possible and how to accomplish it I'd appreciate
>>it.
>>
>> Thanks,
>> Jim
>>
>
>
Re: question on howto change the row background based on table data [message #76576 is a reply to message #76560] Thu, 22 September 2005 16:05 Go to previous messageGo to next message
James Norris is currently offline James NorrisFriend
Messages: 52
Registered: July 2009
Member
Ok, the duplicate row is due extra rows being put into the dataset in the
app. Now I just need to see why the highlight is happening when it
shouldn't be.

-Jim

"jnorris" <james.norris@pb.com> wrote in message
news:dguk47$f92$1@news.eclipse.org...
> Actually this doesn't work correctly after all. I have two conditions set
> to highlight the first column in the report based on comparing values of
> two columns from the dataset. In the designer preview it works as
> expected. However, when I run the application using the same dataset I am
> getting two rows in the report table for each row in the dataset with the
> second row being highlighted when it shouldn't be.
>
> Any ideas?
>
> Thanks,
> Jim
>
> "jnorris" <james.norris@pb.com> wrote in message
> news:dguitu$dls$1@news.eclipse.org...
>> Found this answer in a previous post from Jason Weathersby and it works
>> for me:
>>
>> Select the fields in the row and choose the highlights tab under the
>> Property
>> Editor. Add a condition for the highlight and set the background color.
>>
>> -Jim
>>
>> "jnorris" <james.norris@pb.com> wrote in message
>> news:dgugk5$a75$1@news.eclipse.org...
>>>I would like to be able to change the background color for a row in a
>>>table based on the value of some of the items in the row. If someone
>>>could tell me if this is possible and how to accomplish it I'd appreciate
>>>it.
>>>
>>> Thanks,
>>> Jim
>>>
>>
>>
>
>
Re: question on howto change the row background based on table data [message #76624 is a reply to message #76560] Thu, 22 September 2005 16:31 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Jim,
Can you post your report design or build the same type of report using the
built in classic model source and reproduce the problem?

Jason Weathersby
BIRT PMC

"jnorris" <james.norris@pb.com> wrote in message
news:dguk47$f92$1@news.eclipse.org...
> Actually this doesn't work correctly after all. I have two conditions set
> to highlight the first column in the report based on comparing values of
> two columns from the dataset. In the designer preview it works as
> expected. However, when I run the application using the same dataset I am
> getting two rows in the report table for each row in the dataset with the
> second row being highlighted when it shouldn't be.
>
> Any ideas?
>
> Thanks,
> Jim
>
> "jnorris" <james.norris@pb.com> wrote in message
> news:dguitu$dls$1@news.eclipse.org...
>> Found this answer in a previous post from Jason Weathersby and it works
>> for me:
>>
>> Select the fields in the row and choose the highlights tab under the
>> Property
>> Editor. Add a condition for the highlight and set the background color.
>>
>> -Jim
>>
>> "jnorris" <james.norris@pb.com> wrote in message
>> news:dgugk5$a75$1@news.eclipse.org...
>>>I would like to be able to change the background color for a row in a
>>>table based on the value of some of the items in the row. If someone
>>>could tell me if this is possible and how to accomplish it I'd appreciate
>>>it.
>>>
>>> Thanks,
>>> Jim
>>>
>>
>>
>
>
Re: question on howto change the row background based on table data [message #76656 is a reply to message #76624] Thu, 22 September 2005 17:11 Go to previous messageGo to next message
James Norris is currently offline James NorrisFriend
Messages: 52
Registered: July 2009
Member
Hi Jason,

I think I'm just not writing the condition correctly. I'm trying to compare
two date fields and the condition reads:

row["ACTUAL_DATE"] Less than row["TARGET_DATE"]

I need the comparison to be based on just the year/month/day so I probably
need to strip off that part of the date object. I'm assuming that I will
have to use javascript to accomplish this but I'm open to help or
suggestions on how to do it.

Also I have a grid in the report where I have the following in one of the
cells:
new String( "Target Date: " ) + row["TARGET_DATE"]

In the property editor I have "Format DateTime" set to "9/22/05". However
in the report preview the full date prints out as "Target Date: 2005-09-22
13:04:45.233". Is there some other way to format the date object?

Thanks,
Jim


"Jason Weathersby" <jweathersby@actuate.com> wrote in message
news:dgum81$icp$1@news.eclipse.org...
> Jim,
> Can you post your report design or build the same type of report using the
> built in classic model source and reproduce the problem?
>
> Jason Weathersby
> BIRT PMC
>
> "jnorris" <james.norris@pb.com> wrote in message
> news:dguk47$f92$1@news.eclipse.org...
>> Actually this doesn't work correctly after all. I have two conditions
>> set to highlight the first column in the report based on comparing values
>> of two columns from the dataset. In the designer preview it works as
>> expected. However, when I run the application using the same dataset I am
>> getting two rows in the report table for each row in the dataset with the
>> second row being highlighted when it shouldn't be.
>>
>> Any ideas?
>>
>> Thanks,
>> Jim
>>
>> "jnorris" <james.norris@pb.com> wrote in message
>> news:dguitu$dls$1@news.eclipse.org...
>>> Found this answer in a previous post from Jason Weathersby and it works
>>> for me:
>>>
>>> Select the fields in the row and choose the highlights tab under the
>>> Property
>>> Editor. Add a condition for the highlight and set the background color.
>>>
>>> -Jim
>>>
>>> "jnorris" <james.norris@pb.com> wrote in message
>>> news:dgugk5$a75$1@news.eclipse.org...
>>>>I would like to be able to change the background color for a row in a
>>>>table based on the value of some of the items in the row. If someone
>>>>could tell me if this is possible and how to accomplish it I'd
>>>>appreciate it.
>>>>
>>>> Thanks,
>>>> Jim
>>>>
>>>
>>>
>>
>>
>
>
Re: question on howto change the row background based on table data [message #76688 is a reply to message #76656] Thu, 22 September 2005 21:32 Go to previous message
Rima Kanguri is currently offline Rima KanguriFriend
Messages: 110
Registered: July 2009
Senior Member
Jnorris,
About your question related to formatting the date field.

[ Question -
I have a grid in the report where I have the following in one of the
cells: new String( "Target Date: " ) + row["TARGET_DATE"]

In the property editor I have "Format DateTime" set to "9/22/05". However
in the report preview the full date prints out as "Target Date: 2005-09-22
13:04:45.233". Is there some other way to format the date object?
]

One way of doing it would be:
- Firstly the formatting through property editor applies only if the data item
return date type. In your case the value is string.
- You might want to add a text item ( instead of a date item) to the grid cell,
change the content type = html/dynamic text

And enter the following value:

Target Date = <VALUE-OF format="MMM-dd-YYYY" >row["TARGET_DATE"]</VALUE-OF>

--Rima Kanguri


jnorris wrote:

> Hi Jason,
>
> I think I'm just not writing the condition correctly. I'm trying to compare
> two date fields and the condition reads:
>
> row["ACTUAL_DATE"] Less than row["TARGET_DATE"]
>
> I need the comparison to be based on just the year/month/day so I probably
> need to strip off that part of the date object. I'm assuming that I will
> have to use javascript to accomplish this but I'm open to help or
> suggestions on how to do it.
>
> Also I have a grid in the report where I have the following in one of the
> cells:
> new String( "Target Date: " ) + row["TARGET_DATE"]
>
> In the property editor I have "Format DateTime" set to "9/22/05". However
> in the report preview the full date prints out as "Target Date: 2005-09-22
> 13:04:45.233". Is there some other way to format the date object?
>
> Thanks,
> Jim
>
> "Jason Weathersby" <jweathersby@actuate.com> wrote in message
> news:dgum81$icp$1@news.eclipse.org...
> > Jim,
> > Can you post your report design or build the same type of report using the
> > built in classic model source and reproduce the problem?
> >
> > Jason Weathersby
> > BIRT PMC
> >
> > "jnorris" <james.norris@pb.com> wrote in message
> > news:dguk47$f92$1@news.eclipse.org...
> >> Actually this doesn't work correctly after all. I have two conditions
> >> set to highlight the first column in the report based on comparing values
> >> of two columns from the dataset. In the designer preview it works as
> >> expected. However, when I run the application using the same dataset I am
> >> getting two rows in the report table for each row in the dataset with the
> >> second row being highlighted when it shouldn't be.
> >>
> >> Any ideas?
> >>
> >> Thanks,
> >> Jim
> >>
> >> "jnorris" <james.norris@pb.com> wrote in message
> >> news:dguitu$dls$1@news.eclipse.org...
> >>> Found this answer in a previous post from Jason Weathersby and it works
> >>> for me:
> >>>
> >>> Select the fields in the row and choose the highlights tab under the
> >>> Property
> >>> Editor. Add a condition for the highlight and set the background color.
> >>>
> >>> -Jim
> >>>
> >>> "jnorris" <james.norris@pb.com> wrote in message
> >>> news:dgugk5$a75$1@news.eclipse.org...
> >>>>I would like to be able to change the background color for a row in a
> >>>>table based on the value of some of the items in the row. If someone
> >>>>could tell me if this is possible and how to accomplish it I'd
> >>>>appreciate it.
> >>>>
> >>>> Thanks,
> >>>> Jim
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >
Previous Topic:Stored procedure parameters
Next Topic:Start swt Shell widget from script
Goto Forum:
  


Current Time: Thu Jan 02 20:44:31 GMT 2025

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

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

Back to the top