Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Oracle Report builder Row/field formating.

853 views
Skip to first unread message

Ronen Malka

unread,
Sep 3, 2002, 2:39:39 PM9/3/02
to
Hi,
I need to achieve the following tasks in my reports:

1) Use deferent colors for odd / even rows in a tabular report
2) Color a row according to conditional value of a field (for example
if field1 >10000 then the wall row will be red)

is it possible to do that in oracle report builder?
if yes where can I find examples or PL/SQL code for that?

Thanx,
-Ronen

Martin Doherty

unread,
Sep 3, 2002, 4:24:11 PM9/3/02
to
The basic method is to superimpose another frame/field/rectangle or
whatever, and then put a trigger on that layout object so that it
conditionally prints or doesn't print depending on the data in that row.

For instance, to use odd/even coloring, your data model should include an
invisible counter item that tells you the current row #, then in PL/SQL
you can use the mod function to find out if it's an even row or an odd
row, and return true or false from the layout trigger of the beige
rectangle that is placed inside the repeating frame but underneath the
printable fields. This can be tricky to get in the right place, so the
object navigator is your best guide. Put the colored rectangle exactly on
top of the fields you want to color, then move it backwards one step at a
time (each time you do so, one more field should appear in front of the
rectangle) but stop while it is still inside the repeating frame.

Similar technique will work for field > 10000 - you can manually add a
new layout field with a red background with the same source data item
exactly superimposed on top of the original layout field, put a layout
trigger on the new field to return true only if the data item is > 10000.

HTH
Martin

martin.doherty.vcf

Yann CAUCHARD

unread,
Sep 4, 2002, 4:55:55 AM9/4/02
to
Hi,

you can use conditionnal formating.

hth

Yann

Ronen Malka a écrit dans le message
<8057a19b.02090...@posting.google.com>...

Joost Bataille

unread,
Sep 4, 2002, 5:09:56 AM9/4/02
to

"Ronen Malka" <ron...@fundtech.com> wrote in message
news:8057a19b.02090...@posting.google.com...

> I need to achieve the following tasks in my reports:
>
> 1) Use deferent colors for odd / even rows in a tabular report
> 2) Color a row according to conditional value of a field (for example
> if field1 >10000 then the wall row will be red)

Hello Ronen,
you can do this with the format triggers and the
srw.set_background_fill_color built in.
Check the online help on this. It can be tricky because you also have to set
a background fill pattern. I have an example at home and post this tomorrow.
Regards, Joost
--
Joost Bataille
University of Amsterdam ICT centre

Joost Bataille

unread,
Sep 5, 2002, 3:30:15 AM9/5/02
to

>
> "Ronen Malka" <ron...@fundtech.com> wrote in message

> > I need to achieve the following tasks in my reports:
> >
> > 1) Use deferent colors for odd / even rows in a tabular report
> > 2) Color a row according to conditional value of a field (for example
> > if field1 >10000 then the wall row will be red)
>
> Hello Ronen,
> you can do this with the format triggers and the
> srw.set_background_fill_color built in.
> Check the online help on this. It can be tricky because you also have to
set
> a background fill pattern. I have an example at home and post this
tomorrow.

The problem is: you can not set the background _color_ of an item, you can
only set the colors of the _fill pattern_.
These patterns can be seen in the layout editor, when you click the dripping
paint can icon and then 'Patterns'. These patters have a foregroundcolor and
a background color. Both can be set with the srw package:
srw.set_foreground_fill_color('<color name>') and
srw.set_background_color('<color name>');
If you move the mouse over a pattern, its's name is shown in the bottom left
corner of the layout editor window. The same for colors.
The pattern itself can be set at design time in the layout editor or
programatically with srw.set_fill_pattern('<pattern_name>');

My code in the format trigger looks like this:

function R_G_namenFormatTrigger return boolean is
begin
srw.set_fill_pattern('solid');
if <condition> then
srw.set_foreground_fill_color('gray4');
else
srw.set_foreground_fill_color('white');
end if;

return (TRUE);
end;

I used this to have an alternating background color on a repeating frame.
Hope this helps, regards.

0 new messages