root / UFRapLogeT.pas
Historique | Voir | Annoter | Télécharger (3,156 ko)
1 | 3 | avalancogn | unit UFRapLogeT ;
|
---|---|---|---|
2 | |||
3 | interface
|
||
4 | |||
5 | uses
|
||
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
||
7 | Dialogs, OleCtrls, StdCtrls, ComCtrls, DB, DBClient, ExtCtrls, QRCtrls, |
||
8 | QuickRpt, QRPrntr, MidasLib, UVariables, gnugettext; |
||
9 | |||
10 | type
|
||
11 | TFRapLogeT = class(TForm)
|
||
12 | QRRapport: TQuickRep; |
||
13 | PHBRapport: TQRBand; |
||
14 | DBRapport: TQRBand; |
||
15 | QRLInraPorc: TQRLabel; |
||
16 | QRLTitre: TQRLabel; |
||
17 | CDSRapport: TClientDataSet; |
||
18 | SFLoge: TStringField; |
||
19 | PFBRapport: TQRBand; |
||
20 | QRLUser: TQRLabel; |
||
21 | QRLWarning: TQRLabel; |
||
22 | QRLLoge: TQRLabel; |
||
23 | QRDBTLoge: TQRDBText; |
||
24 | QRLMemo: TQRLabel; |
||
25 | QRMMemo: TQRMemo; |
||
26 | QRSDDate: TQRSysData; |
||
27 | QRSEntete: TQRShape; |
||
28 | DSRelation: TDataSource; |
||
29 | CDSRegles: TClientDataSet; |
||
30 | SFLogeKey: TStringField; |
||
31 | IFNo: TIntegerField; |
||
32 | SFModeFin: TStringField; |
||
33 | SFAliment: TStringField; |
||
34 | QRLRegles: TQRLabel; |
||
35 | QRLNo: TQRLabel; |
||
36 | QRDBTNo: TQRDBText; |
||
37 | QRShape2: TQRShape; |
||
38 | QRLModeFin: TQRLabel; |
||
39 | QRDBTModeFin: TQRDBText; |
||
40 | QRSDRegles: TQRSubDetail; |
||
41 | TBRapport: TQRBand; |
||
42 | QRDBTEtat: TQRDBText; |
||
43 | IFEtatKey: TIntegerField; |
||
44 | IFEtat: TIntegerField; |
||
45 | SFStrEtat: TStringField; |
||
46 | QRIInraPorc: TQRImage; |
||
47 | procedure FormCreate(Sender: TObject);
|
||
48 | private
|
||
49 | { D?clarations priv?es }
|
||
50 | public
|
||
51 | { D?clarations publiques }
|
||
52 | end;
|
||
53 | |||
54 | var
|
||
55 | FRapLogeT: TFRapLogeT; |
||
56 | |||
57 | implementation
|
||
58 | |||
59 | uses
|
||
60 | UStrings, UUtil, UFLogeT, UFPrevRap ; |
||
61 | |||
62 | {$R *.dfm}
|
||
63 | |||
64 | { TFRapLogeT }
|
||
65 | |||
66 | procedure TFRapLogeT.FormCreate(Sender: TObject);
|
||
67 | var
|
||
68 | etat, regle, nb : integer; |
||
69 | begin
|
||
70 | if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
||
71 | then
|
||
72 | Font.Name := 'Arial Unicode MS';
|
||
73 | TranslateComponent(Self); |
||
74 | // Licence
|
||
75 | if IsEducation and (Length (Course) > 0) |
||
76 | then
|
||
77 | QRLUSer.Caption := Format('%s (%s)', [Course, Company])
|
||
78 | else
|
||
79 | if IsComplete or IsEducation |
||
80 | then
|
||
81 | QRLUSer.Caption := Format('%s %s (%s)', [FirstName, LastName, Company])
|
||
82 | else
|
||
83 | if IsEvaluation
|
||
84 | then
|
||
85 | QRLUSer.Caption := StrEvaluation |
||
86 | else
|
||
87 | begin
|
||
88 | QRLUSer.Caption := StrReadOnly; |
||
89 | QRLUser.Font.Color := clRed; |
||
90 | end;
|
||
91 | with CDSRapport do |
||
92 | begin
|
||
93 | CreateDataSet; |
||
94 | for etat := 0 to 2 do |
||
95 | begin
|
||
96 | Append; |
||
97 | FieldValues['_Loge_'] := FLogeT.CBLoge.Text;
|
||
98 | FieldValues['_Etat_'] := etat;
|
||
99 | FieldValues['_StrEtat_'] := FLogeT.TC.Tabs[etat];
|
||
100 | Post; |
||
101 | end;
|
||
102 | end;
|
||
103 | QRMMemo.Lines.Add(FLogeT.CBLoge.Hint); |
||
104 | with CDSRegles do |
||
105 | begin
|
||
106 | CreateDataSet; |
||
107 | for etat := 0 to 2 do |
||
108 | begin
|
||
109 | case etat of |
||
110 | 0 : // Gestation |
||
111 | nb := PLogeT.NbRuleGest; |
||
112 | 1 : // Lactation |
||
113 | nb := PLogeT.NbRuleLact; |
||
114 | else // I.S.S.F. |
||
115 | nb := PLogeT.NbRuleISSF; |
||
116 | end;
|
||
117 | for regle := 1 to nb do |
||
118 | begin
|
||
119 | Append; |
||
120 | FieldValues['_Loge_'] := FLogeT.CBLoge.Text;
|
||
121 | FieldValues['_Etat_'] := etat;
|
||
122 | FieldValues['_No_'] := regle;
|
||
123 | FieldValues['_ModeFin_'] := FLogeT.StrModeFin(etat, regle);
|
||
124 | Post; |
||
125 | end;
|
||
126 | end;
|
||
127 | end;
|
||
128 | RegisterPreviewClass(TQRPrevRapInterface); |
||
129 | // QRRapport.PreviewModal;
|
||
130 | // RegisterPreviewClass(TQRStandardPreviewInterface);
|
||
131 | end;
|
||
132 | |||
133 | end. |