Delphi Reports

The default components for Delphi reports are on the QReport tab. Unfortunately, the help is worthless - key infornation is missing. Some information is available at QuSoft AS, the developers of QuickReports.

QuickReports 3.5 has much better help that 3.0 which ships with Delphi 5. However, there are still too many references to the web page which, as far as I can tell, contains no additional help.

The basic problem using QuickReports the first time is that all the bands are turned off. And no, the help does not tell you this.

Use QRDBText to display both text and memo data.

Basic Procedure

On a new form, place a DataAccess/Table and a QReport/QuickRep.

Double click QuickRep1 and be sure that the Detail band is checked. Place a QReport/QRDBText object in the Detail band.


Right click QuickRep1 and select Preview. (You could also open the Report Settings dialog box (double click QuickRep1) and click the Preview button.)

That should give you a basic report.

The next step is to display the report by running the form. At run time you can call QuickRep1.Preview or QuickRep1.Print to generate the report. This might be placed in the form's OnCreate event.

To see preview data, you MAY have to set Table1.Active to true. I think I've seen it both ways.

A Custom Preview Form

Add Win32/ToolBar, place at least one button on it (for print).

Place a QReport/QRPreview component. At run time, you want this component aligned to the client and in front of the other components. However, if you set those parameters now, you will not be able to design anything now. Therefore, leave the preview component small, on top, and out of the way. When the form starts, set QRPreview1.Align to alClient.

Place the following in QuickRep1.OnPreview

QRPreview1.QRPrinter := TQRPrinter(Sender);

The TQRPreview Properties, Methods and Events are not documented in either 3.0 or 3.5 help.

Author: Robert Clemenzi -
URL: http:// / user / clemenzi / technical / Databases / Delphi / Reports.html