Solved

Dynamically placing labels on a QuickReport

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

19 Experts available now in Live!

Get 1:1 Help Now