Solved

Preview Form using Quick Report 2.0

Posted on 1997-08-25
4
783 Views
Last Modified: 2010-05-18
Can somebody explain to me and send me a full example of how to create and use a preview form other than the default one used by quick report 2.0
0
Comment
Question by:malaland
[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
4 Comments
 
LVL 1

Expert Comment

by:sxh
ID: 1342485
hi malaland

here is the extract from the Quickreport 0.97 manual for creating custom previews. It should'nt be that much different in delphi 2.0

Regards

sxh

Creating Custom Preview

A professional looking print preview is essential to the overall feel of your product.
One nice feature of QuickReport is the ability to create your own preview forms.  QuickReport is intended to integrate 100% with your application and to enable that you can very easily create your own report preview using the TQRPreview component.

There is also a very simple preview form included with the demonstration program. Take a look at DEMOPRE.PAS.

Basically creating a preview form consist of two steps
* Create a form with a TQRPreview component, plus any other components you would want.
* Show the your preview form in the QRPrinter.OnPreview event.

Following is a step by step guide to create a very simple preview form:

1. Open the Test project created above
2. Select File | New Form and double click on a blank form if you get the form gallery
3. Set the Name property of the form to MyPreviewForm
4. Drop a TQRPreview component on the form
5. Set the Align property to alClient
6. Select File | Save file and save the unit as MYPREV
7. Open the MAINFORM and view the source code
8. In the uses clause at the top add QUICKREP and MYPREV to the end of the list
9. Insert the following line in the MAINFORM.OnCreate event:
 
  QRPrinter.OnPreview := MyPreview;

10. Add The following procedure to the end of the code:
  procedure MyPreview;
  begin
     MyPrevForm.ShowModal;
  end;

13. Compile the project and preview the simple demo report.

You have now created a preview form that shows the first page of the report at 100% of the size. Maximise the form, and you see more of the report.

Now you can add an action bar to your preview form. Put components on it to change the PageNumber and Zoom properties of the aPreview component.
0
 

Author Comment

by:malaland
ID: 1342486
Sorry, but I guess you did not understood the question.

First I want to create a preview form with version 2.0 not 1.2, if that was the case I already know the answer to the question. There is a big difference between the two version. First there is no program called DEMOPRE.PAS in Delphi 3 that is why I asked for an example since there are none.

So thanks again bu the question still stands as it is. Same amount of points.

Hope to here from yourself or another experts.
0
 

Accepted Solution

by:
xire earned 120 total points
ID: 1342487
ok
do the following
1) create new form (let's call it rpreview)
2) put TQRPreview on this form
3) on your QuickRep form in QuickRep OnPreview event write this
   rpreview.QRPreview1.QRPrinter := QuickRep.QRPrinter; // this is the           //difference from qr1, i.e. you must assign QRPrinter
   rpreview.Show;

and that's it. Whenever you call YourReport.Preview rpreview form will appear.

hope it helps


0
 

Author Comment

by:malaland
ID: 1342488
You were right on the spot
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

691 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