Home General

Visibility of component depending on the nr of the column

edited September 2011 in General
Hi,

I have a ppSubReport1, with 3 columns, with ColumnTravers - ctLeftToRight.
I have a ppLine1, with position - lpRight, set to parent height, that I want
to use as a visible separator between Columns 1 and 2, and between 2 and 3.

The only problem is that it is obviously being drawn in the rightmost column
too,
eg.

XXXXX | YYYYYY | ZZZZZZ |
XXXXX | YYYYYY | ZZZZZZ |

But I would like:

XXXXX | YYYYYY | ZZZZZZ
XXXXX | YYYYYY | ZZZZZZ

I have tried in several different events something like:

if ppReport1.engine.currentcolumn = 3 then
ppLine1.Visible := False
Else
ppLine1.Visible := True;

This however does not want to work for me.

Any pointers will be appreciated
Regards

Adrian Wreyford

Comments

  • edited September 2011
    Hi Adrian,

    The column number returned from the CurrentColumn property is zero based
    so your conditional statement will never be true for a three column report.

    Be sure you are using an event such as the Line.OnPrint to toggle the
    visibility. The Left-To-Right column engine calculates the column
    number after the Band.BeforePrint event fires so this event will not
    give you the effect you are after.

    Best Regards,

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