Borland C + + Builder is a visual programming environment based on the C + + language, which provides a reusable component library and a series of RAD design tools that allow programmers to create efficient Windows applications, especially complex database access applications, with a small amount of manual code. So deeply loved by software developers.
When you develop a database to access an application, it often involves printing problems with the report. C + + Builder provides a quick report (Quick Statement) component for programmers to design reports. Quick Report is Norway's Qusoft as company specifically designed for C + + Builder to make reports of a set of controls, in C + + Builder The Help document about quick Reporting is not very detailed. In addition, it is not consistent with the style of other controls in C + + Builder. The report preview function that directly uses the Quick report does not always achieve satisfactory results, so it is necessary to customize the preview window for the Quick reports.
Set Preview window
Create a new project, add a toolbar control on the Form1 form, and add the following buttons to it: Print, Print Setup,
Back, Next, zoom, zoom out, and close. "" Add a Panel control on the Form1 form, set to Albottom, and add a ProgressBar control (alignment to Alleft) and a panel control (Name Panel2) on this Panel control. The alignment is set to Alright,bevelouter set to bvlowered, which is used to display report mount progress and other informational information, respectively. Add a Qrpreview control to the Form1 form, and the alignment is set to Alclient.
Create a new form, set its name to Form2, add the Tquickrep control to the form, set its name to QuickRep1, and the Units property in its printersetting to mm (measured in millimeters), and then build the report.
Programmatic implementation
1. Select QuickRep1 on Form2, select Onpreview in its event, and enter the following code: