Solved

Preview Form using Quick Report 2.0

Posted on 1997-08-25
4
774 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
  • 2
4 Comments
 
LVL 1

Expert Comment

by:sxh
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
You were right on the spot
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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

14 Experts available now in Live!

Get 1:1 Help Now