?
Solved

Quickreport: second try to preview fails

Posted on 2003-03-07
9
Medium Priority
?
271 Views
Last Modified: 2013-11-22
What problem can there be?
I open the preview and after closing I get only a blank sheet in the preview?
Did you solve this problem?
0
Comment
Question by:canorikurt
[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
9 Comments
 
LVL 7

Expert Comment

by:Motaz
ID: 8088115
Can you post your code that preview report here, and after preview code,
Example


Tabl1.Open...
...
QuickReport1.preview;
Table1.Close;
....

Motaz
0
 
LVL 11

Expert Comment

by:calinutz
ID: 8088186
The problem you have is probabely that you forgot to link the datasource to the report form  and to the report. You have to include your datamodule (or the form that contains your datasources) into the report form (uses clause)
   I work a lot with QuickReport and I had this kind of errors on my screen a couple of times.
    Cheers.
0
 
LVL 1

Expert Comment

by:jturpin
ID: 8088270

You may need to ensure that either a TQRBand or a TQRGroup has something to show. Try dropping a TQRLabel just to test it.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:canorikurt
ID: 8088331
Thank you all!
The problem was solved by setting the QReport.tag to zero after in my OnNeedData event there is:

  if QReport1.tag=0 then
    begin
    MoreData:=true;
    QReport1.Tag:=1;
    end
  else
    MoreData:=false;

But now I can see a more problematic preview. The QRLabels I use for displaying my data are still on the preview.

How can I blank my preview canvas. Is there a canvas?

Alternative question: how can I release created QRLabels on the fly? Is there a handle (e.g. 0..50) to count back and free the methods?
0
 
LVL 7

Accepted Solution

by:
Motaz earned 200 total points
ID: 8088820
You should clear it's data:

QRLabel1.Caption:= '';

If you are creating these labels at run time then you should assign nil in Owner, and put save all of them in a list:

public
  QRLabels: array of TQRLabel;



while you creating them:

var
  Lab: TQRLabel;
begin
for i:= 1 to 10 do
begin
  SetLength(QRLabels, Length(QRLabels) + 1);
  Lab:= TQRLabel.Create(nil);
  Lab.Parent:= QuickReport1; // Or band
  Lab.Caption:= 'put your data here';
  QRlabels[High(QRLabels)]:= Lab;
end;
end;

Then when you close your report release all created labels:

for i:= 0 to High(QRLabels) do
  QRLabels[i].Free;
SetLength(QRLabels, 0);

Motaz
0
 

Expert Comment

by:Dj_Frogman
ID: 8387622
Do not do anything of that.
Insert a line before preview:

Quickreport.prepare;

Tha will do the catch.
0
 

Expert Comment

by:CleanupPing
ID: 9316898
canorikurt:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 5

Expert Comment

by:snehanshu
ID: 10045143
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: Motaz

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 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