Re: Report builder 6 - How to number and grey lines in report?

From: Joost Bataille <j.r.l.m.batailleREMOVETHIS_at_uva.nl>
Date: Thu, 11 Oct 2001 16:28:14 +0200
Message-ID: <9q4a9u$k7d$1_at_mail.ic.uva.nl>


Hello Luc, you wrote

> I have a report based on a view.
> It's a huge one so people reading it ask for 2 things
> 1. a number in front of each line
> 2. 1 line on 2 must be grey
>
> How to do that? I'm far to be an expert in Report.

  1. I would have to think about that, no time at this moment. Maybe later...
  2. This I've tried myself. It's not very easy but here you go:
    - it's done by changing the foreground color of a fill pattern from white to
    gray while keeping the background color white.
    - open the layout editor
    • select the repeating frame where your record-items are on. For hints on how to do this, check my posting in this news group from 4 oct 2001 'Reports 6i: showing data from another query'.
    • click on the 'fill color' button, the dripping paint can, and select 'patterns'
    • now select a pattern thats half white-half black
    • at the bottom of this 'Fill pattern palette' there are buttons for selecting the color for the foreground color of the fill pattern (left half) and the background color of the fill pattern (right half). Select black for the left half, white for the right half (while selecting a color you can see it's name displayed at the bottom of the layout-editor window, in the status line)
    • with the repeating frame still selected, close the layout editor
    • Now it's time to make the 'switching mechanism'. You need some variable that is known everywhere in the report. You can do this with a global variable or with a package variable. I use a package with one variable
    • in the object navigator, under the node 'Program units', create a package specification with the name 'globalen'.
    • the code should look like this: PACKAGE globalen IS tonen boolean := false; END;
    • then select your repeating frame again (if you have trouble locating it in the object navigator, open the layout editor, select the frame and close the layout editor)
    • go to the property 'Format trigger', it will look something like function <name of the item>FormatTrigger return boolean is begin

  return (TRUE);
end;

  • add these lines between 'begin' and 'return (TRUE)': if globalen.tonen = false then srw.set_foreground_fill_color('white'); globalen.tonen := true; elsif globalen.tonen = true then srw.set_foreground_fill_color('gray8'); globalen.tonen := false; end if;
  • this code uses a Reports built in procedure to change the foreground color of the fill. If this color is white ande the background color is also white then there will be no visible fill
  • if you want every new page of your report to start with a grey line, you have to create a (predefined) Report trigger, 'between pages' to set the value of your pacakage variable. Something like function BetweenPage return boolean is begin globalen.tonen := true; return (TRUE); end;
  • That's it for question 2

You could use this package also for record numbering:
- create another variable in your package 'globalen': teller number := 0;

  • in the data model editor, create a formula column in the group with your items
  • set the properties of this column to datatype number and write in the formula: return 'teller + 1;'
  • create a field in your repeting frame and set it's source property to the formula column you've created. Hmm, this may be a little too complicated...

Does this help?

Regards, Joost Received on Thu Oct 11 2001 - 16:28:14 CEST

Original text of this message