Statistiques
| Révision:

root / UFRapportAli.pas

Historique | Voir | Annoter | Télécharger (4,091 ko)

1 3 avalancogn
unit UFRapportAli ;
2
3
interface
4
5
uses
6
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7
  Dialogs, StdCtrls, Buttons, ExtCtrls, QuickRpt, UVariables, gnugettext;
8
9
type
10
  TFRapportAli = class(TForm)
11
    SBRapAliElem: TSpeedButton;
12
    SBRapAliAA: TSpeedButton;
13
    SBRapAliAG: TSpeedButton;
14
    SBRapAliMin: TSpeedButton;
15
    SBRapAliMat: TSpeedButton;
16
    ChkRapAliElem: TCheckBox;
17
    ChkRapAliAA: TCheckBox;
18
    ChkRapAliAG: TCheckBox;
19
    CHKRapAliMin: TCheckBox;
20
    ChkRapAliMat: TCheckBox;
21
    PMat: TPanel;
22
    BBPrint: TBitBtn;
23
    PD: TPrintDialog;
24
    BBClose: TBitBtn;
25
    procedure SBRapAliElemClick(Sender: TObject);
26
    procedure SBRapAliAAClick(Sender: TObject);
27
    procedure SBRapAliAGClick(Sender: TObject);
28
    procedure SBRapAliMinClick(Sender: TObject);
29
    procedure SBRapAliMatClick(Sender: TObject);
30
    procedure FormShow(Sender: TObject);
31
    procedure BBPrintClick(Sender: TObject);
32
    procedure ChkRapAliClick(Sender: TObject);
33
    procedure FormCreate(Sender: TObject);
34
  private
35
    { D?clarations priv?es }
36
  public
37
    { D?clarations publiques }
38
  end;
39
40
var
41
  FRapportAli : TFRapportAli ;
42
43
implementation
44
45
uses
46
  Printers, UUtil, UFRapAliElem, UFRapAliAA, UFRapAliAG, UFRapAliMin,
47
  UFRapAliMat ;
48
49
{$R *.dfm}
50
51
{ TFRapportAli }
52
53
procedure TFRapportAli.FormCreate(Sender: TObject);
54
begin
55
  if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1
56
  then
57
    Font.Name := 'Arial Unicode MS';
58
  TranslateComponent(Self);
59
end;
60
61
procedure TFRapportAli.FormShow(Sender: TObject);
62
begin
63
  PMat.Visible:= ConfAffMP;
64
end;
65
66
procedure TFRapportAli.ChkRapAliClick(Sender: TObject);
67
begin
68
  BBPrint.Enabled := (IsComplete or IsEducation)
69
    and (ChkRapAliElem.Checked or ChkRapAliAA.Checked or ChkRapAliAG.Checked or ChkRapAliMin.Checked or ChkRapAliMat.Checked);
70
end;
71
72
procedure TFRapportAli.SBRapAliElemClick(Sender: TObject);
73
begin
74
  FRapAliElem := TFRapAliElem.Create (Self) ;
75
  FRapAliElem.QRRapport.PreviewModal ;
76
  FRapAliElem.Release ;
77
end;
78
79
procedure TFRapportAli.SBRapAliAAClick(Sender: TObject);
80
begin
81
  FRapAliAA := TFRapAliAA.Create (Self) ;
82
  FRapAliAA.QRRapport.PreviewModal ;
83
  FRapAliAA.Release ;
84
end;
85
86
procedure TFRapportAli.SBRapAliAGClick(Sender: TObject);
87
begin
88
  FRapAliAG := TFRapAliAG.Create (Self) ;
89
  FRapAliAG.QRRapport.PreviewModal ;
90
  FRapAliAG.Release ;
91
end;
92
93
procedure TFRapportAli.SBRapAliMinClick(Sender: TObject);
94
begin
95
  FRapAliMin := TFRapAliMin.Create (Self) ;
96
  FRapAliMin.QRRapport.PreviewModal ;
97
  FRapAliMin.Release ;
98
end;
99
100
procedure TFRapportAli.SBRapAliMatClick(Sender: TObject);
101
begin
102
  FRapAliMat := TFRapAliMat.Create (Self) ;
103
  FRapAliMat.QRRapport.PreviewModal ;
104
  FRapAliMat.Release ;
105
end;
106
107
procedure TFRapportAli.BBPrintClick(Sender: TObject);
108
begin
109
  if PD.Execute
110
  then
111
  begin
112
    if ChkRapAliElem.Checked
113
    then
114
    begin
115
      FRapAliElem := TFRapAliElem.Create (Self) ;
116
      FRapAliElem.QRRapport.PrinterSettings.PrinterIndex := Printer.PrinterIndex;
117
      FRapAliElem.QRRapport.Print ;
118
      FRapAliElem.Release ;
119
    end ;
120
    if ChkRapAliAA.Checked
121
    then
122
    begin
123
      FRapAliAA := TFRapAliAA.Create (Self) ;
124
      FRapAliAA.QRRapport.PrinterSettings.PrinterIndex := Printer.PrinterIndex;
125
      FRapAliAA.QRRapport.Print ;
126
      FRapAliAA.Release ;
127
    end ;
128
    if ChkRapAliAG.Checked
129
    then
130
    begin
131
      FRapAliAG := TFRapAliAG.Create (Self) ;
132
      FRapAliAG.QRRapport.PrinterSettings.PrinterIndex := Printer.PrinterIndex;
133
      FRapAliAG.QRRapport.Print ;
134
      FRapAliAG.Release ;
135
    end ;
136
    if ChkRapAliMin.Checked
137
    then
138
    begin
139
      FRapAliMin := TFRapAliMin.Create (Self) ;
140
      FRapAliMin.QRRapport.PrinterSettings.PrinterIndex := Printer.PrinterIndex;
141
      FRapAliMin.QRRapport.Print ;
142
      FRapAliMin.Release ;
143
    end ;
144
    if ChkRapAliMat.Checked
145
    then
146
    begin
147
      FRapAliMat := TFRapAliMat.Create (Self) ;
148
      FRapAliMat.QRRapport.PrinterSettings.PrinterIndex := Printer.PrinterIndex;
149
      FRapAliMat.QRRapport.Print ;
150
      FRapAliMat.Release ;
151
    end ;
152
    Close;
153
  end;
154
end;
155
156
end.