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
Solved

Dynamically placing labels on a QuickReport

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Comparing dates in Delphi. Greater than/ Less than 3 214
Create Database on Android via Delphi dbExpress 3 110
LAN or WAN ? 11 95
PHP preg_replace code convert to Delphi 14 66
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…

840 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