Board index » delphi » Quick report labels

Quick report labels

Can anyone give me a snipped of code that will let me change the caption
on a label.
I thought that the following might work but I put a trace on the line
and this never seems to be executed.

procedure TComplaintSummaryReport.ColumnHeaderBand1BeforePrint(
  Sender: TQRCustomBand; var PrintBand: Boolean);
begin
    ColumnHeaderBand1.Color := clred;
    QRLabel1.Caption := 'My own Name';
end;

Thanks
David

 

Re:Quick report labels


David you are correct, but instead 'BeforePrnt'  you have to use OnPrint
event.
Marek.
Quote
David Panter wrote in message <37284E3A.6E42B...@ozemail.com.au>...
>Can anyone give me a snipped of code that will let me change the caption
>on a label.
>I thought that the following might work but I put a trace on the line
>and this never seems to be executed.

>procedure TComplaintSummaryReport.ColumnHeaderBand1BeforePrint(
>  Sender: TQRCustomBand; var PrintBand: Boolean);
>begin
>    ColumnHeaderBand1.Color := clred;
>    QRLabel1.Caption := 'My own Name';
>end;

>Thanks
>David

Re:Quick report labels


Thanks for the tip. There is no OnPrint event for the column header band. But
you put me on the right track and I have it sorted  now. I was never firing
the Before print event for this band (silly me).
She it apples now .
Dave
Quote
Marek wrote:
> David you are correct, but instead 'BeforePrnt'  you have to use OnPrint
> event.
> Marek.

> David Panter wrote in message <37284E3A.6E42B...@ozemail.com.au>...
> >Can anyone give me a snipped of code that will let me change the caption
> >on a label.
> >I thought that the following might work but I put a trace on the line
> >and this never seems to be executed.

> >procedure TComplaintSummaryReport.ColumnHeaderBand1BeforePrint(
> >  Sender: TQRCustomBand; var PrintBand: Boolean);
> >begin
> >    ColumnHeaderBand1.Color := clred;
> >    QRLabel1.Caption := 'My own Name';
> >end;

Other Threads