No data behavior

edited December 2006 in Subreports
Hi,

In a subreport I have a following situation.

SubReport.ppDetailBand.BeforePrint:
if condition = true
then ppDetailBand.Visible = true
else ppDetailBand.Visible = false

Sometimes the DetailDataset has 5 records but non of them are printed
because of the condition in the beforeprint.

How can I prevent the TitleBand of the Subreport being printed in this case
?
Or better : If no Detailbands printed in the Subreport then Subreport.not
visible in MainReport.

I tried using a ppVariable (incremented when condition is True) but I didn't
find the a correct calctype/calccomponent and/or event in the subreport or
mainreport to prevent the printing.

The subreport is part of the MainReport.Detailband

I am using Delphi 7 RB 9.02

Tnx in advance,

Eddy Van Steenbergen

Comments

  • edited December 2006
    Hi Eddy,

    Since you are setting the visibility of the detail band as the report is
    generating, there is no way to go back once you are finished and remove a
    section of the report that has already been generated. In this case you
    will need to perhaps traverse the data before hand and find out if any of
    the current data passes the condition. Then toggle the detail band based on
    that information.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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