Custom Preview window in C++builder

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.