Solved

Dynamically placing labels on a QuickReport

Posted on 1998-08-28
3
867 Views
Last Modified: 2013-11-22
Hi folks.

There is a first for everything, so here goes.
I am trying to create a generic report enginge which
is to use QR2.0K to generate reports - however I
stumbled upon a problem! I can't seem to be able
to create labels dynamically. Must labels be
placed on Bands ? And must QR use a table
to create the report ? If so, does anybody know
any report-tools that aren't dependant on tables
but can use them ?

Could somebody give me an example of
how they create a label at runtime and plz
add source ?

I havent got a clue as to the worth of this
question so its guessing :-)

faithfully

GOMF
0
Comment
Question by:GOMF
  • 2
3 Comments
 
LVL 4

Expert Comment

by:itamar
ID: 1337956
Hi GOMF,

QR is not completely dependent of DataSets. Take a look on the OnNeedData event documentation.

About creating Labels dynamically, I hope your talking about TQRLabel and not TLabel components. If so I don´t see any troubles. Try to create them on the BeforePrint event, perhaps setting TQRLabel.Parent := QRBand will complete the job.

I didn´t try it as I don´t have Delphi in this box, right now.

IHTH,
Itamar
0
 
LVL 4

Accepted Solution

by:
itamar earned 120 total points
ID: 1337957
Hi GOMF,

now I have tried it. This is the code:

.
var
  MyLabel: array[0..10] of TQRLabel;
.

procedure TQRListForm.QuickReportBeforePrint(Sender: TQuickRep;
  var PrintReport: Boolean);
begin
  MyLabel[0] := TQRLabel.Create(Self);
  With MyLabel[0] do begin
     Caption := 'My Label';
     Left := 300;
     Top := 6;
     Parent := PageHeader;
  end;
end;

IHTH,
Itamar
0
 

Author Comment

by:GOMF
ID: 1337958
Dear Itamar.

Thank you for a simple explanation - Appearantly
my problem was that I didn't do this at
the "Beforeprint" event.



GOMF


0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question