Can't assign DetailBand events in code
Delphi 6, RB Ent 10.07.
At design-time I can see four events against TppDetailBand (AfterGenerate,
AfterPrint, BeforeGenerate and BeforePrint).
However, if I wanted to not set those at design time, but at run-time, I
can't see how to get access to the event? That's if I use
ppReport1.DetailBand.
Looking through the RB source, the BeforePrintEvent is part of the
BandEngine but neither the BeforePrint event nor the BandEngine are
available in code to use, so I can't assign a handler to the the event. The
only event available appears to be OnPrint which isn't actually one of the
published events in the Obj Inspector.
However, if I use ppReport1.Bands[0]. then the events are available to me.
However, then I'm not sure I'm setting the correct band.
And if I cast the DetailBand as a TppBand, then I get the event:
TppBand(ppEmployeeBadge.DetailBand).BeforePrint
Why aren't the events available for the ppReport.DetailBand property? Surely
it's a TppBand descendant?
Thanks,
J.
--
Jason Sweby
Software Development Manager,
Carval Computing Limited, Plymouth, UK
Payroll - HR - T&A - Access Control
At design-time I can see four events against TppDetailBand (AfterGenerate,
AfterPrint, BeforeGenerate and BeforePrint).
However, if I wanted to not set those at design time, but at run-time, I
can't see how to get access to the event? That's if I use
ppReport1.DetailBand.
Looking through the RB source, the BeforePrintEvent is part of the
BandEngine but neither the BeforePrint event nor the BandEngine are
available in code to use, so I can't assign a handler to the the event. The
only event available appears to be OnPrint which isn't actually one of the
published events in the Obj Inspector.
However, if I use ppReport1.Bands[0]. then the events are available to me.
However, then I'm not sure I'm setting the correct band.
And if I cast the DetailBand as a TppBand, then I get the event:
TppBand(ppEmployeeBadge.DetailBand).BeforePrint
Why aren't the events available for the ppReport.DetailBand property? Surely
it's a TppBand descendant?
Thanks,
J.
--
Jason Sweby
Software Development Manager,
Carval Computing Limited, Plymouth, UK
Payroll - HR - T&A - Access Control
This discussion has been closed.
Comments
TppBand defines BeforePrint, AfterPrint etc. as a published properties. All
bands descend from TppBand.
Either of these will compile....
ppReport1.DetailBand.BeforePrint := ehDetail_BeforePrint;
or
ppReport1.Detail.BeforePrint := ehDetail_BeforePrint;
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
appear in Delphi's CodeCompletion box. But entering it anyway and compiling
worked.
Thanks.