Statistiques
| Révision:

root / UFRapMatElem.pas @ 3

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

1
unit UFRapMatElem;
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
  TFRapMatElem = class(TForm)
12
    QRRapport: TQuickRep;
13
    PHBRapport: TQRBand;
14
    DBRapport: TQRBand;
15
    QRLTitre: TQRLabel;
16
    QRLMatiere: 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
    SFMatiere: TStringField;
26
    QRDBMatiere: 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
  FRapMatElem: TFRapMatElem;
125

    
126
implementation
127

    
128
uses
129
  UStrings, UCalcul, UUtil, UFMatiere, UFPrevRap;
130

    
131
{$R *.dfm}
132

    
133
{ TFRapMatElem }
134

    
135
procedure TFRapMatElem.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['_Matiere_'] := FMatiere.CBMatiere.Text;
163
    FieldValues['_TMS_'] := FMatiere.PBTMS.Text;
164
    FieldValues['_TMM_'] := FMatiere.PBTMM.Text;
165
    FieldValues['_TMO_'] := FMatiere.PBTMO.Text;
166
    FieldValues['_TLip_'] := FMatiere.PBTLip.Text;
167
    FieldValues['_TMAT_'] := FMatiere.PBTMAT.Text;
168
    FieldValues['_TAmidon_'] := FMatiere.PBTAmidon.Text;
169
    FieldValues['_TSucres_'] := FMatiere.PBTSucres.Text;
170
    FieldValues['_dMO_C_'] := FMatiere.PBdMO_C.Text;
171
    FieldValues['_dMO_T_'] := FMatiere.PBdMO_T.Text;
172
    FieldValues['_dLip_C_'] := FMatiere.PBdLip_C.Text;
173
    FieldValues['_dLip_T_'] := FMatiere.PBdLip_T.Text;
174
    FieldValues['_dMAT_C_'] := FMatiere.PBdMAT_C.Text;
175
    FieldValues['_dMAT_T_'] := FMatiere.PBdMAT_T.Text;
176
    FieldValues['_dAmidon_'] := FMatiere.PBdAmidon_C.Text;
177
    FieldValues['_dSucres_'] := FMatiere.PBdSucres_C.Text;
178
    FieldValues['_EB_'] := FMatiere.PBEB_C.Text;
179
    FieldValues['_ED_C_'] := FMatiere.PBED_C.Text;
180
    FieldValues['_ED_T_'] := FMatiere.PBED_T.Text;
181
    FieldValues['_EM_C_'] := FMatiere.PBEM_C.Text;
182
    FieldValues['_EM_T_'] := FMatiere.PBEM_T.Text;
183
    FieldValues['_EN_C_'] := FMatiere.PBEN_C.Text;
184
    FieldValues['_EN_T_'] := FMatiere.PBEN_T.Text;
185
    FieldValues['_CB_'] := FMatiere.PBCB.Text;
186
    FieldValues['_NDF_'] := FMatiere.PBNDF.Text;
187
    FieldValues['_ADF_'] := FMatiere.PBADF.Text;
188
    FieldValues['_ADL_'] := FMatiere.PBADL.Text;
189
    FieldValues['_Parois_'] := FMatiere.PBParois.Text;
190
    Post;
191
  end;
192
  QRMMemo.Lines.Add(FMatiere.CBMatiere.Hint);
193
  QRLCompo.Caption := FMatiere.Hint;
194
  QRLTFecale.Caption := FMatiere.GBTFecale.Caption;
195
  QRLdFecale.Caption := FMatiere.GBdFecale.Caption;
196
  QRLTFibres.Caption := FMatiere.GBFibres.Caption;
197
  RegisterPreviewClass(TQRPrevRapInterface);
198
//  QRRapport.PreviewModal;
199
//  RegisterPreviewClass(TQRStandardPreviewInterface);
200
end;
201

    
202
end.