Solved

Preview Form using Quick Report 2.0

Posted on 1997-08-25
4
779 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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