Statistiques
| Révision:

root / UFRapAliElem.pas @ 3

Historique | Voir | Annoter | Télécharger (5,769 ko)

1 3 avalancogn
unit UFRapAliElem ;
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
  TFRapAliElem = class(TForm)
12
    QRRapport: TQuickRep;
13
    PHBRapport: TQRBand;
14
    DBRapport: TQRBand;
15
    QRLTitre: TQRLabel;
16
    QRLAliment: TQRLabel;
17
    CDSRapport: TClientDataSet;
18
    PFBRapport: TQRBand;
19
    QRLUser: TQRLabel;
20
    QRLWarning: TQRLabel;
21
    QRLMemo: TQRLabel;
22
    QRMMemo: TQRMemo;
23
    QRSDDate: TQRSysData;
24
    QRSEntete: TQRShape;
25
    SFAliment: TStringField;
26
    QRDBAliment: TQRDBText;
27
    QRLTFecale: TQRLabel;
28
    QRLMS: TQRLabel;
29
    QRDBTTMS: TQRDBText;
30
    QRLFecale: TQRLabel;
31
    QRLdFecale: TQRLabel;
32
    QRSdFecale: TQRShape;
33
    QRLdFecale_C: TQRLabel;
34
    QRLdFecale_T: TQRLabel;
35
    QRLMO: TQRLabel;
36
    QRDBTTMO: TQRDBText;
37
    QRLMAT: TQRLabel;
38
    QRDBTTMAT: TQRDBText;
39
    QRLSucres: TQRLabel;
40
    QRDBTTSucres: TQRDBText;
41
    QRLMM: TQRLabel;
42
    QRDBTTMM: TQRDBText;
43
    QRLLip: TQRLabel;
44
    QRDBTTLip: TQRDBText;
45
    QRLAmidon: TQRLabel;
46
    QRDBTTAmidon: TQRDBText;
47
    QRDBTdMO_C: TQRDBText;
48
    QRDBTdMAT_C: TQRDBText;
49
    QRDBTdLip_C: TQRDBText;
50
    QRDBTdMO_T: TQRDBText;
51
    QRDBTdMAT_T: TQRDBText;
52
    QRDBTdLip_T: TQRDBText;
53
    QRDBTdSucres_C: TQRDBText;
54
    QRDBTdAmidon_C: TQRDBText;
55
    QRDBTdSucres_T: TQRDBText;
56
    QRDBTdAmidon_T: TQRDBText;
57
    SFTMS: TStringField;
58
    SFTMM: TStringField;
59
    SFdMO_T: TStringField;
60
    SFdLip_T: TStringField;
61
    SFdMAT_T: TStringField;
62
    SFdAmidon: TStringField;
63
    SFdSucres: TStringField;
64
    SFTMO: TStringField;
65
    SFTLip: TStringField;
66
    SFTMAT: TStringField;
67
    SFTAmidon: TStringField;
68
    SFTSucres: TStringField;
69
    SFdMO_C: TStringField;
70
    SFdLip_C: TStringField;
71
    SFdMAT_C: TStringField;
72
    QRLEB: TQRLabel;
73
    QRDBTEB_C: TQRDBText;
74
    QRLEnergie: TQRLabel;
75
    QRLEVal: TQRLabel;
76
    QRSEVal: TQRShape;
77
    QRLEVal_C: TQRLabel;
78
    QRLEVal_T: TQRLabel;
79
    QRLabel1: TQRLabel;
80
    QRDBTEM_C: TQRDBText;
81
    QRLabel2: TQRLabel;
82
    QRDBTED_C: TQRDBText;
83
    QRLabel3: TQRLabel;
84
    QRDBTEN_C: TQRDBText;
85
    QRDBTEB_T: TQRDBText;
86
    QRDBTEM_T: TQRDBText;
87
    QRDBTED_T: TQRDBText;
88
    QRDBTEN_T: TQRDBText;
89
    SFEM_C: TStringField;
90
    SFEB: TStringField;
91
    SFEN_C: TStringField;
92
    SFED_C: TStringField;
93
    SFED_T: TStringField;
94
    SFEM_T: TStringField;
95
    SFEN_T: TStringField;
96
    QRLTFibres: TQRLabel;
97
    QRLCB: TQRLabel;
98
    QRDBTCB: TQRDBText;
99
    QRLFibres: TQRLabel;
100
    QRLADF: TQRLabel;
101
    QRDBTADF: TQRDBText;
102
    QRLParois: TQRLabel;
103
    QRDBTParois: TQRDBText;
104
    QRLNDF: TQRLabel;
105
    QRDBTNDF: TQRDBText;
106
    QRLADL: TQRLabel;
107
    QRDBTADL: TQRDBText;
108
    SFCB: TStringField;
109
    SFNDF: TStringField;
110
    SFADF: TStringField;
111
    SFADL: TStringField;
112
    SFParois: TStringField;
113
    QRLCompo: TQRLabel;
114
    QRIInraPorc: TQRImage;
115
    QRLInraPorc: TQRLabel;
116
    procedure FormCreate(Sender: TObject);
117
  private
118
    { D?clarations priv?es }
119
  public
120
    { D?clarations publiques }
121
  end;
122
123
var
124
  FRapAliElem: TFRapAliElem;
125
126
implementation
127
128
uses
129
  UStrings, UCalcul, UUtil, UFAliment, UFPrevRap ;
130
131
{$R *.dfm}
132
133
{ TFRapAliElem }
134
135
procedure TFRapAliElem.FormCreate(Sender: TObject);
136
begin
137
  if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1
138
  then
139
    Font.Name := 'Arial Unicode MS';
140
  TranslateComponent(Self);
141
  // Licence
142
  if IsEducation and (Length (Course) > 0)
143
  then
144
    QRLUSer.Caption := Format('%s (%s)', [Course, Company])
145
  else
146
  if IsComplete or IsEducation
147
  then
148
    QRLUSer.Caption := Format('%s %s (%s)', [FirstName, LastName, Company])
149
  else
150
  if IsEvaluation
151
  then
152
    QRLUSer.Caption := StrEvaluation
153
  else
154
  begin
155
    QRLUSer.Caption := StrReadOnly;
156
    QRLUser.Font.Color := clRed;
157
  end;
158
  with CDSRapport do
159
  begin
160
    CreateDataSet;
161
    Append;
162
    FieldValues['_Aliment_']:= FAliment.CBAliment.Text;
163
    FieldValues['_TMS_']:= FAliment.PBTMS.Text;
164
    FieldValues['_TMM_']:= FAliment.PBTMM.Text;
165
    FieldValues['_TMO_']:= FAliment.PBTMO.Text;
166
    FieldValues['_TLip_']:= FAliment.PBTLip.Text;
167
    FieldValues['_TMAT_']:= FAliment.PBTMAT.Text;
168
    FieldValues['_TAmidon_']:= FAliment.PBTAmidon.Text;
169
    FieldValues['_TSucres_']:= FAliment.PBTSucres.Text;
170
    FieldValues['_dMO_C_']:= FAliment.PBdMO_C.Text;
171
    FieldValues['_dMO_T_']:= FAliment.PBdMO_T.Text;
172
    FieldValues['_dLip_C_']:= FAliment.PBdLip_C.Text;
173
    FieldValues['_dLip_T_']:= FAliment.PBdLip_T.Text;
174
    FieldValues['_dMAT_C_']:= FAliment.PBdMAT_C.Text;
175
    FieldValues['_dMAT_T_']:= FAliment.PBdMAT_T.Text;
176
    FieldValues['_dAmidon_']:= FAliment.PBdAmidon_C.Text;
177
    FieldValues['_dSucres_']:= FAliment.PBdSucres_C.Text;
178
    FieldValues['_EB_']:= FAliment.PBEB_C.Text;
179
    FieldValues['_ED_C_']:= FAliment.PBED_C.Text;
180
    FieldValues['_ED_T_']:= FAliment.PBED_T.Text;
181
    FieldValues['_EM_C_']:= FAliment.PBEM_C.Text;
182
    FieldValues['_EM_T_']:= FAliment.PBEM_T.Text;
183
    FieldValues['_EN_C_']:= FAliment.PBEN_C.Text;
184
    FieldValues['_EN_T_']:= FAliment.PBEN_T.Text;
185
    FieldValues['_CB_']:= FAliment.PBCB.Text;
186
    FieldValues['_NDF_']:= FAliment.PBNDF.Text;
187
    FieldValues['_ADF_']:= FAliment.PBADF.Text;
188
    FieldValues['_ADL_']:= FAliment.PBADL.Text;
189
    FieldValues['_Parois_']:= FAliment.PBParois.Text;
190
    Post;
191
  end ;
192
  QRMMemo.Lines.Add(FAliment.CBAliment.Hint);
193
  QRLCompo.Caption:= FAliment.Hint;
194
  QRLTFecale.Caption:= FAliment.GBTFecale.Caption;
195
  QRLdFecale.Caption:= FAliment.GBdFecale.Caption;
196
  QRLTFibres.Caption:= FAliment.GBFibres.Caption;
197
  RegisterPreviewClass(TQRPrevRapInterface);
198
//  QRRapport.PreviewModal;
199
//  RegisterPreviewClass(TQRStandardPreviewInterface);
200
end;
201
202
end.