Board index » delphi » Creating labels at runtime

Creating labels at runtime

I using QuickReports v2.0 and Delphi 3.0.  I am trying to create labels
at runtime and adding them to a summary band.  I create the label, set
its parent to the summary band, and set some other properties all in the
before print of the summary band.  I recieve a data access violation
error at runtime.  It says error reading memory address.  Does anyone
know whats wrong with this??

Melissa

 

Re:Creating labels at runtime


Quote
Melissa Thobe wrote:
> I using QuickReports v2.0 and Delphi 3.0.  I am trying to create
> labels
> at runtime and adding them to a summary band.  I create the label, set

> its parent to the summary band, and set some other properties all in
> the
> before print of the summary band.  I recieve a data access violation
> error at runtime.  It says error reading memory address.  Does anyone
> know whats wrong with this??

> Melissa

Assuming you are using the addprintable method to create the labels the
"latest" you can use this is the beforeprint event of the report.

John

Re:Creating labels at runtime


Quote
Melissa Thobe wrote:

> I using QuickReports v2.0 and Delphi 3.0.  I am trying to create labels
> at runtime and adding them to a summary band.  I create the label, set
> its parent to the summary band, and set some other properties all in the
> before print of the summary band.  I recieve a data access violation
> error at runtime.  It says error reading memory address.  Does anyone
> know whats wrong with this??

Melissa,

Do you also create the form at runtime? The form has to exist before you
can access the data. So it has to be something like

MyPrintForm := TMyPrintForm.Create(Self);

  with MyPrintForm do
  begin
   ... open the database, do the stuf you wanna do
  end;

MyPrintForm.Free;

Kind regards, Leo

Other Threads