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;