home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Buyer 1998 October
/
dpcb1098.iso
/
Business
/
Maxim
/
MAX5
/
data.z
/
MAIN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-05-13
|
2KB
|
69 lines
unit main;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, DBTables, Report, ExtCtrls, Buttons;
type
TMainForm = class(TForm)
Report: TReport;
Query1: TQuery;
Rgrp_State: TRadioGroup;
Rgrp_Mode: TRadioGroup;
Btn_Run: TBitBtn;
procedure Btn_RunClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Rgrp_StateClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
{$R *.DFM}
procedure TMainForm.Btn_RunClick(Sender: TObject);
begin
If RGrp_Mode.ItemIndex = 1 then
begin
Report.Preview := False;
Report.AutoUnload := True;
Query1.ParamByName('ST').AsString := Rgrp_State.Items[Rgrp_State.Itemindex];
Query1.Open;
Report.Run;
end
else
begin
Report.Preview := True;
Report.AutoUnload := False;
Query1.ParamByName('ST').AsString := Rgrp_State.Items[Rgrp_State.Itemindex];
Report.run;
end;
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
MainForm.height := 114;
MainForm.width := 314;
Query1.ParamByName('ST').AsString := 'HI';
Report.ReportDir := ExtractFilePath(Application.ExeName);
end;
procedure TMainForm.Rgrp_StateClick(Sender: TObject);
begin
Query1.ParamByName('ST').AsString :=
Rgrp_State.Items[Rgrp_State.Itemindex];
Query1.Open;
If FindWindowEx(0,0,nil,'RS_Runtime') <> 0 then
Report.RecalcReport;
end;
end.