unit Uotch;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, IBCustomDataSet, IBQuery, QuickRpt, QRCtrls, ExtCtrls,
  ComCtrls;

type
  TFotch = class(TForm)
    Qotch: TIBQuery;
    QotchDATA: TDateTimeField;
    QotchOTDEL: TIBStringField;
    QotchFIO: TIBStringField;
    QotchDOLCH: TIBStringField;
    QotchVOPROS: TIBStringField;
    QotchUROVEN: TSmallintField;
    QotchOTVET: TIBStringField;
    QotchPRAVDA: TSmallintField;
    QuickRep1: TQuickRep;
    QRBand1: TQRBand;
    QRSysData1: TQRSysData;
    QRBand2: TQRBand;
    QRLabel1: TQRLabel;
    QRBand4: TQRBand;
    QRDBText5: TQRDBText;
    QRDBText6: TQRDBText;
    QRBand5: TQRBand;
    QRLabel2: TQRLabel;
    QRExpr3: TQRExpr;
    QRGroup1: TQRGroup;
    QRDBText1: TQRDBText;
    QRGroup2: TQRGroup;
    QRDBText2: TQRDBText;
    QRGroup3: TQRGroup;
    QRExpr2: TQRExpr;
    QRBand3: TQRBand;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRGroup4: TQRGroup;
    QRExpr1: TQRExpr;
    QRBand9: TQRBand;
    vivod: TQRLabel;
    procedure QRBand5AfterPrint(Sender: TQRCustomBand;
      BandPrinted: Boolean);
    procedure QRGroup2AfterPrint(Sender: TQRCustomBand;
      BandPrinted: Boolean);
    procedure QRGroup3AfterPrint(Sender: TQRCustomBand;
      BandPrinted: Boolean);
    procedure QRBand9BeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure QRBand4BeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure QRGroup4BeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
  private
    { Private declarations }
  public
  ur,ur1,ur2:double;
   name:string;
    { Public declarations }
  end;

var
  Fotch: TFotch;

implementation

uses Udatav;

{$R *.dfm}

procedure TFotch.QRBand5AfterPrint(Sender: TQRCustomBand;
  BandPrinted: Boolean);
begin
if ur=1 then ur1:=qrexpr3.Value.dblResult;
if ur=2 then ur2:=qrexpr3.Value.dblResult;
qrexpr3.Reset;
end;

procedure TFotch.QRGroup2AfterPrint(Sender: TQRCustomBand;
  BandPrinted: Boolean);
begin
name:=qotchfio.Value;
ur1:=0;
ur2:=0;
end;

procedure TFotch.QRGroup3AfterPrint(Sender: TQRCustomBand;
  BandPrinted: Boolean);
begin
ur:=qotchuroven.Value;
end;

procedure TFotch.QRBand9BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
if ur1<62 then vivod.Caption:=name+' Уровень знания стат методов МЕНЕЕ НУЛЕВОГО';
if (ur1>62)and (ur1<100) then vivod.Caption:=name+' Уровень знания стат методов НУЛЕВОЙ';
if (ur1=100)and (ur2<42.8) then vivod.Caption:=name+' Уровень знания стат методов ПЕРВЫЙ';
if (ur1=100)and (ur2>=42.8) then vivod.Caption:=name+' Уровень знания стат методов ВТОРОЙ';
end;

procedure TFotch.QRBand4BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
with datav do begin
if length(qotchotvet.Value)>150 then begin
qrband4.Height:=40;
qrdbtext5.Height:=40;
qrdbtext6.Height:=40;
end else begin
qrband4.Height:=20;
qrdbtext5.Height:=20;
qrdbtext6.Height:=20;
end;
end;

end;

procedure TFotch.QRGroup4BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
with datav do begin
if length(qotchvopros.Value)>80 then begin
qrgroup4.Height:=40;
qrexpr1.Height:=40;
end else begin
qrgroup4.Height:=24;
qrexpr1.Height:=24;
end;
end;
end;

end.
