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

Skipping labels.

edited April 2004 in General
I know this is a reoccurring theme in this group. I have a quick question.
I have followed your skip label example and I have made one change that I
thought would work but it has not. Because our customer can load a custom
label at run time I don't know each field to set it's visible property to
false so I just set -> ppReport1.DetailBand.Visible := False;

However I still see the labels I wanted to skip.

One questions.

Will setting the detailband.visible to false do what I am
expecting........mainly suppress all the printing to the page but Rbuilder
still thinks it printed a label in that position so it moves to the next.

Thanks

Comments

  • edited April 2004
    Hi Paul,

    Which event are you setting the DetailBand.Visible := False? You are going
    to want to use the DetalBand.BeforePrint event to check a condition and set
    the visible property. If you are already doing this, please send a small
    example demonstrating this behavior to support@digital-metaphors.com and
    I'll take a look at it.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2004
    Nico,
    here is the only change I made to your skip label project.

    procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
    begin
    if ((((ppReport1.CurrentColumn - 1) * FTotalBandsPerColumn) +
    ppReport1.DetailBand.Count) = (FSkip - 1)) then
    begin
    ppReport1.DetailBand.BandsPerRecord := 1;

    ppDBCalc1.Visible := True;
    ppDBText1.Visible := True;
    ppReport1.DetailBand.Visible := True;
    end
    else
    ppReport1.DetailBand.Visible := False;
    end;

    I would expect this to print one label down the page by the number of fskip
    when the label number is = fskip-1.

    nothing at all prints out

    Am I thinking wrong?




  • edited April 2004
    I noted that if the detailband.visible := flase then the detail bandcount
    remain's at 0 and does not increment.

    Is this a bug or is this as expected.

    Thanks in advance for your help

  • edited April 2004
    Hi Paul,

    After further research, it looks as though setting the detail band's
    visibility to False will not work for the Skip Labels example. The example
    relies on the DetailBand.Count property to increment to work correctly yet
    when you set the detail band's visibility property to False, this property
    does not increment because there is no detail band present. My suggestion
    would be to possibly place a TppRegion inside the Detail band with invisible
    borders and ParentHeight and ParentWidth set to True and toggle the
    visibility of that object rather than the entire band. If the region is not
    visible, your users will not even know it is there for the most part.

    --
    Best Regards,

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