Solved

Dynamically placing labels on a QuickReport

Posted on 1998-08-28
3
921 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 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