Solved

Dynamically placing labels on a QuickReport

Posted on 1998-08-28
3
820 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now