Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Color detail fields based on ppVariable in surrounding group

edited May 2004 in General
Hi All,

I have a report where order lines are printed. All records are printed in
the detail band. The surrounding group is based on the order number and is
only used to break and reset variables.

If (at least) one of the order lines has a specific property set, I want to
color the amount field of all order lines belonging to the same order
yellow. Normally the amount field color is white.

My approach was using a lookahead boolean variable calculated on traversal
and reset on group end, indicating which color to use. If I print this
variable in the detail band it prints the correct value. Only I can't use
this value to set the color of another field.

Example (specific property is [X])

ppVariable (lookahead)
------------------------------------------------------------
order 1 [ ] FALSE --> white
order 1 [ ] FALSE --> white
order 2 [X] TRUE --> yellow
order 2 [ ] TRUE --> stays yellow
order 3 [ ] TRUE --> white
*** but I would like it to be yellow :-(
order 3 [X] TRUE --> yellow
order 3 [ ] TRUE --> yellow

Who has a solution to this problem?

Some additional info: Data is (of course) sorted on order number. report is
2-pass. using RB 7.03 and RAP.

Thanks in advance,
Jeroen Rottink

Comments

  • edited May 2004
    Hi Jeroen,

    The problem is that ReportBuilder was not designed to traverse a dataset and
    create drawcommands for each report object in a separate instance during
    generation. This would be the only way to solve this issue inside the
    report. The easiest way to work around this issue would be to either order
    your data so that if an order does in fact have a record with the specific
    property set to True, it is the first record traversed, or traverse the
    dataset manually before calling Report.Print, creating a list of orders that
    need to be yellow. Then using the DetailBand.BeforePrint event, changing
    the color of the report componentes based on which order you are on.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.