Customizing the Print preview window for a quick report

Source: Internet
Author: User

The default Print preview window provided in QuickReport2.0 is an English-language interface, and if the Chinese software is developed with this English display, there are some minor flaws. Therefore, it is necessary to implement the Chinese Interface Print Preview window. But there is no Print preview window in the source code provided by Delphi. Pas source files, this can not directly modify the source code, can only be realized by their own programming. After many times of practice, the author has implemented a print preview window similar to the default preview window, with the same function. The steps are as follows:

1. Create a new form and set name to Mypreview.

2. Add a Toolbar control on the form, mimic the default preview window to create the corresponding Toolbutton, and set the hint hint for each button.

3. Add a Panel control and align to Albottom. Then put a ProgressBar (left alignment) and panel (right) on this panel to display the report mount progress and other prompts separately.

4. Add the Qrpreview control and align to alclient.

5. Add OpenDialog, set Filter property to *. QR; add Savedialog, set Filter property to *. qr|*. txt|*. htm|*. CSV, set the Defaultext property to *. Qr.

6. Double-click each Toolbutton to enter the appropriate code.

You can invoke the Custom Preview window in the following ways.

Overload the Tquickrep Onpreview event, enter the following code:

procedureTRptForm.RptFormPreview(Sender:TObject);
begin
withTMyPreview.Create(Application)do
begin
QRPreview1.QRPrinter:=TQRPrinter(Sender);
CurRep:=self;
Show;
end;
end;

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.