unit u_prev;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
qrprntr, ComCtrls, ToolWin, ExtCtrls, Menus, ImgList, StdCtrls, comobj, Grids,
Db, DBTables, QuickRpt;
type
Tf_prev = class(TForm)
QRPreview1: TQRPreview;
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton5: TToolButton;
ToolButton6: TToolButton;
ToolButton7: TToolButton;
ToolButton8: TToolButton;
ToolButton10: TToolButton;
ImageList1: TImageList;
ToolButton4: TToolButton;
ToolButton9: TToolButton;
ToolButton11: TToolButton;
ToolButton12: TToolButton;
ToolButton13: TToolButton;
StatusBar1: TStatusBar;
PopupMenu1: TPopupMenu;
N751: TMenuItem;
N501: TMenuItem;
N251: TMenuItem;
PopupMenu2: TPopupMenu;
MenuItem1: TMenuItem;
MenuItem2: TMenuItem;
MenuItem3: TMenuItem;
PrintersetupDialog1: TPrinterSetupDialog;
PrintDialog1: TPrintDialog;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
N11: TMenuItem;
N12: TMenuItem;
N13: TMenuItem;
N14: TMenuItem;
N1001: TMenuItem;
N1101: TMenuItem;
N1251: TMenuItem;
N7551: TMenuItem;
N502: TMenuItem;
N252: TMenuItem;
ToolButton14: TToolButton;
SaveDialog1: TSaveDialog;
N15: TMenuItem;
StringGrid1: TStringGrid;
Query1: TQuery;
StringGrid2: TStringGrid;
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure ToolButton2Click(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton6Click(Sender: TObject);
procedure QRPreview1PageAvailable(Sender: TObject;
PageNum: Integer);
procedure ToolButton7Click(Sender: TObject);
procedure ToolButton8Click(Sender: TObject);
procedure ToolButton4Click(Sender: TObject);
procedure ToolButton10Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure ToolButton13Click(Sender: TObject);
procedure N751Click(Sender: TObject);
procedure N501Click(Sender: TObject);
procedure N251Click(Sender: TObject);
procedure MenuItem1Click(Sender: TObject);
procedure MenuItem2Click(Sender: TObject);
procedure MenuItem3Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure N8Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N1001Click(Sender: TObject);
procedure N1101Click(Sender: TObject);
procedure N1251Click(Sender: TObject);
procedure N7551Click(Sender: TObject);
procedure N502Click(Sender: TObject);
procedure N252Click(Sender: TObject);
procedure ToolButton14Click(Sender: TObject);
procedure N15Click(Sender: TObject);
procedure SaveExcel(psSaveFile :string);
private
{ Private declarations }
public
{ Public declarations }
end;
var
f_prev: Tf_prev;
pagecount:integer;
implementation
uses pass;
{$R *.DFM}
procedure Tf_prev.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
try
qrpreview1.qrprinter:=nil;
qrpreview1.qrprinter.free;
stringgrid1.Destroy;
except
end;
end;
procedure Tf_prev.ToolButton2Click(Sender: TObject);
begin
qrpreview1.ZoomToWidth;
end;
procedure Tf_prev.ToolButton5Click(Sender: TObject);
begin
if pagecount=0 then
exit;
qrpreview1.pagenumber:=1;
toolbutton5.enabled:=false;
toolbutton6.enabled:=false;
if pagecount>1 then
begin
toolbutton7.enabled:=true;
toolbutton8.enabled:=true;
end
else
begin
toolbutton7.enabled:=false;
toolbutton8.enabled:=false;
end