root / UFRapAliMat.pas
Historique | Voir | Annoter | Télécharger (2,787 ko)
1 |
unit UFRapAliMat ;
|
---|---|
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 |
TFRapAliMat = 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 |
QRLMat: TQRLabel; |
28 |
QRDBTMat: TQRDBText; |
29 |
QRLTQte: TQRLabel; |
30 |
QRDBTQte: TQRDBText; |
31 |
QRLMS: TQRLabel; |
32 |
QRDBTMS: TQRDBText; |
33 |
DSRelation: TDataSource; |
34 |
CDSMatieres: TClientDataSet; |
35 |
SFMatiere: TStringField; |
36 |
QRSDRegles: TQRSubDetail; |
37 |
SFAlimentKey: TStringField; |
38 |
IFNo: TIntegerField; |
39 |
FFQte: TFloatField; |
40 |
FFMS: TFloatField; |
41 |
QRIInraPorc: TQRImage; |
42 |
QRLInraPorc: TQRLabel; |
43 |
procedure FormCreate(Sender: TObject);
|
44 |
private
|
45 |
{ D?clarations priv?es }
|
46 |
public
|
47 |
{ D?clarations publiques }
|
48 |
end;
|
49 |
|
50 |
var
|
51 |
FRapAliMat: TFRapAliMat; |
52 |
|
53 |
implementation
|
54 |
|
55 |
uses
|
56 |
UStrings, UCalcul, UUtil, UFindRec, UFAliment, UFPrevRap ; |
57 |
|
58 |
{$R *.dfm}
|
59 |
|
60 |
{ TFRapAliMat }
|
61 |
|
62 |
procedure TFRapAliMat.FormCreate(Sender: TObject);
|
63 |
var
|
64 |
i : integer; |
65 |
begin
|
66 |
if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
67 |
then
|
68 |
Font.Name := 'Arial Unicode MS';
|
69 |
TranslateComponent(Self); |
70 |
// Licence
|
71 |
if IsEducation and (Length (Course) > 0) |
72 |
then
|
73 |
QRLUSer.Caption := Format('%s (%s)', [Course, Company])
|
74 |
else
|
75 |
if IsComplete or IsEducation |
76 |
then
|
77 |
QRLUSer.Caption := Format('%s %s (%s)', [FirstName, LastName, Company])
|
78 |
else
|
79 |
if IsEvaluation
|
80 |
then
|
81 |
QRLUSer.Caption := StrEvaluation |
82 |
else
|
83 |
begin
|
84 |
QRLUSer.Caption := StrReadOnly; |
85 |
QRLUser.Font.Color := clRed; |
86 |
end;
|
87 |
with CDSRapport do |
88 |
begin
|
89 |
CreateDataSet; |
90 |
Append; |
91 |
FieldValues['_Aliment_'] := FAliment.CBAliment.Text;
|
92 |
Post; |
93 |
end ;
|
94 |
QRMMemo.Lines.Add(FAliment.CBAliment.Hint); |
95 |
with CDSMatieres do |
96 |
begin
|
97 |
CreateDataSet; |
98 |
if PAliment.MP.NbMat > 0 |
99 |
then
|
100 |
for i := 0 to PAliment.MP.NbMat - 1 do |
101 |
begin
|
102 |
Append; |
103 |
FieldValues['_Aliment_']:= FAliment.CBAliment.Text;
|
104 |
FieldValues['_No_']:= i;
|
105 |
FieldValues['_Matiere_']:= FindNomMatiere(PAliment.MP.NumMat[i]);
|
106 |
FieldValues['_Qte_']:= PAliment.MP.Qte[i];
|
107 |
FieldValues['_MS_']:= PAliment.MP.MS[i];
|
108 |
Post; |
109 |
end ;
|
110 |
end;
|
111 |
RegisterPreviewClass(TQRPrevRapInterface); |
112 |
// QRRapport.PreviewModal;
|
113 |
// RegisterPreviewClass(TQRStandardPreviewInterface);
|
114 |
end;
|
115 |
|
116 |
end.
|