好:
-----------------------------------------------------------------------------
unit Hegebiaozhun;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls, ExtCtrls, Db, ADODB;
type
THege = class(TForm)
PageControl1: TPageControl;
Hegenan: TTabSheet;
Hegenv: TTabSheet;
RadioGroup1: TRadioGroup;
ADOConnectionHG: TADOConnection;
ADOQueryHG1: TADOQuery;
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Hege: THege;
Hegenan:TTabSheet;
RadioGroup1:TRadioGroup;
implementation
{$R *.DFM}
uses
ReportHege;
procedure THege.FormCreate(Sender: TObject);
begin
RadioGroup1.ItemIndex:=0;
end;
procedure THege.Button1Click(Sender: TObject);
begin
adoqueryHG1.close;
adoqueryHG1.sql.clear;
if RadioGroup1.ItemIndex=0 then
adoqueryHG1.sql.add('select * from 大一男生体育合格标准表');
if RadioGroup1.ItemIndex=1 then
adoqueryHG1.sql.add('select * from 大二男生体育合格标准表');
if RadioGroup1.ItemIndex=2 then
adoqueryHG1.sql.add('select * from 大三男生体育合格标准表');
if RadioGroup1.ItemIndex=3 then
adoqueryHG1.sql.add('select * from 大四男生体育合格标准表');
adoqueryHG1.open;
end;
procedure THege.Button2Click(Sender: TObject);
var HegeReportnan:THegeReportnan;
begin
HegeReportnan:=THegeReportnan.create(self);
HegeReportnan.QuickRepHGnan.Preview;
HegeReportnan.free;
end;
end.
-------------------------------------------------------
unit ReportHege;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
QuickRpt, Qrctrls, ExtCtrls;
type
THegeReportnan = class(TForm)
QuickRepHGnan: TQuickRep;
DetailBand1: TQRBand;
QRDBTextHGnan1: TQRDBText;
QRDBTextHGnan2: TQRDBText;
TitleBand1: TQRBand;
QRSubDetail1: TQRSubDetail;
QRLabel1: TQRLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
HegeReportnan: THegeReportnan;
implementation
{$R *.DFM}
uses
Hegebiaozhun;
procedure THegeReportnan.FormCreate(Sender: TObject);
var Hege:THege;
begin
Hege:=THege.Create(application);
if Hege.RadioGroup1.ItemIndex=0
then
QRLabel1.caption:='一年级' ;
QuickRepHGnan.Dataset:=Hege.adoQueryHG1;
QRDBTextHGnan1.Dataset:=Hege.adoQueryHG1;
QRDBTextHGnan1.Datafield:='学号';
QRDBTextHGnan2.Dataset:=Hege.adoQueryHG1;
QRDBTextHGnan2.Datafield:='总得分';
end;
end.