Quickreport preview Form

Is there any way to view the standard quickreport preview form in a delphi application. I can use the form but it does not show up in the forms list. If i use a tool like 'exe2dpr' the form is extracted from the 'exe' file no problem. why is this ?.
If it is not possible to view the form would it be possible to 'chain' the printer setup handler :- 'procedure TQRStandardPreview.PrintSetupClick(Sender: TObject);' to display an alternative setup dialog box ? (I know this is the handler name by using 'exe2dpr').

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.



I have just tried this demo and it works, (preview within a form) thought I am having trouble closing the form....
Note that you need to make sure you call this form with a .show and not  .showmodal becuase you will not be able to close the preview from the preview!!!(Bug)

So say you have form1, form2...

Form1.button1click = form2.show;
Form1.button2ckucj = form2.close;
where Form2 is your report form.
Rob ;-)

Hmm I keep getting internal server error.. so I thought chop up the answer and post as smaller comments.. but doesn't seem to be working..
TQRPreview example

This example creates a report preview that zooms when the preview window is resized.


1      Choose File|New Form. The only Form setting you need to change for this example is the AutoScroll property. Change it to False. This setting allows the runtime preview to automatically zoom when the form is resized. If you were to leave AutoScroll at True, the preview would always display at the QRPreview components Zoom setting (default 100 percent) when the form is resized.
2      Place components on the form in the order shown below and use the Inspector or indicated instruction to set each components values. Leave other values at their defaults.

[from palette]
Table [DataAccess]      DatabaseName property: DBDEMOSTableName property: customer.dbActive property: True
QuickRep [QReport]      DataSet property: Table1OnPreview event: QuickRep1Preview. The Code editor appears. Type this into the new procedure:
QRPreview1.QRPrinter := TQRPrinter(Sender);Return to the form.Right-click the report and choose Send To Back from the popup menu.Double-click the placed report to open the Report Settings dialog. Check the Detail band checkbox, then click OK to create a detail band on the report.
QRDBText [QReport]      Place this component on the reports detail band.DataSet property: Table1DataField property: CompanyAlignToBand property: True
Toolbar [Win32]      No property changes.
Button [Standard]      Place this component on the toolbar.Caption property: &PreviewDouble-click the button to open the Code editor window, and enter this for the Button1Click procedure:
QRPreview [QReport]      Place the component anywhere on the form below the toolbar.Align property: alClient
3      Press F9 to run the program. Press the Preview button to load the preview. Note the zoom change as you resize the form.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

pr_wainwrightAuthor Commented:
I think i must have worded the question badly, I'am trying to manipulate the Quickreport preview form and its event handlers in the IDE, just as can be done with any other form created with Delphi

                           Thanks Paul.

Hi Paul,

What even handlers, are you talking about the events of the form in which you drop the quick report component in design time.. that form is only used by quick rep as a tool for you to lay out your report. unless you introduce the preview component TQrpreview or what ever its called.. then you can do make your own preview screen as described above...
Have you used the preview component?

Oh yes reject my answer if it wasn't what you were looking for. That way your question will be looked at by other experts.

Rob ;-)

pr_wainwrightAuthor Commented:
I know how to use the Quickreport components resonably well. my query is why is the preview form of quickreport not shown in the forms list in the IDE, When it is obviously there in the executable file. I know this because the 'exe2dpr' utility can strip out all forms in an 'exe'. I have done this on a simple report example application and all the forms including the preview form are stripped out in all there glory, and can be viewed like any forms in any Delphi application.

Hmm it seems like I really didn't understand your question... I don't know why? I suppose only the dudes who crated delphi ide know why...

Rob ;-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pr_wainwrightAuthor Commented:
Good try !
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.