Board index » delphi » QRBand - Unable to change BandType at run time.

QRBand - Unable to change BandType at run time.

Can anyone tell me how to change BandType for QRBand at runtime for Delphi
3?
I  write code as:
QRBand1.BandType := rbColumnHeader;
The error message is:
Undeclared identifier: rbColumnHeader.

Thanks a lot!
Charlie Zhang
--
czh...@dataworks.com

 

Re:QRBand - Unable to change BandType at run time.


I tried doing this and gave up.
Ross

Curt Tabor <czh...@dataworks.com> wrote in article
<01bd7d1c$349b6f40$31480...@ctabor.DataWorks.com>...

Quote
> Can anyone tell me how to change BandType for QRBand at runtime for
Delphi
> 3?
> I  write code as:
> QRBand1.BandType := rbColumnHeader;
> The error message is:
> Undeclared identifier: rbColumnHeader.

> Thanks a lot!
> Charlie Zhang
> --
> czh...@dataworks.com

Re:QRBand - Unable to change BandType at run time.


On 11 May 1998 20:17:55 GMT, "Curt Tabor" <czh...@dataworks.com>
wrote:

Quote
>Can anyone tell me how to change BandType for QRBand at runtime for Delphi
>3?
>I  write code as:
>QRBand1.BandType := rbColumnHeader;
>The error message is:
>Undeclared identifier: rbColumnHeader.

The TQRBandType is defined in qrprntr.pas

My app's reports are use a 'base' class derived from TQuickRep. This
provides a abstract method called InitReport. InitReport is where the
report decisions which bands to use. I have not tried to swap bands at
runtime but you might try something similar to this.

theReport.Bands.HasColumnHeader := FALSE;
theReport.Bands.ColumnHeaderBand := nil;
QRBand1.BandType := rbColumnHeader;
theReport.Bands.HasColumnHeader := TRUE;
theReport.Bands.ColumnHeaderBand := QRBand1;

If QRBand1 is a band that theReport is already using, say as a
PageHeaderBand, the band will have to be removed from theReport prior
to the above code.

theReport.Bands.HasPageHeader := FALSE;
theReport.Bands.PageHeaderBand := nil;

The key in both snippets is to make theReport's Bands.WhateverBand to
nil before assigning a new band. Inside my InitReport method I must
always set the specific band property to nil prior to assigning the
band. This is likely your problem/solution.

regards
A.G.

Other Threads