root / UFRapRationP.pas @ 3
Historique | Voir | Annoter | Télécharger (2,884 ko)
1 | 3 | avalancogn | unit UFRapRationP ;
|
---|---|---|---|
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 | TFRapRationP = class(TForm)
|
||
12 | QRRapport: TQuickRep; |
||
13 | PHBRapport: TQRBand; |
||
14 | DBRapport: TQRBand; |
||
15 | QRLTitre: TQRLabel; |
||
16 | QRLRation: TQRLabel; |
||
17 | QRDBTRation: TQRDBText; |
||
18 | CDSRapport: TClientDataSet; |
||
19 | SFRation: TStringField; |
||
20 | PFBRapport: TQRBand; |
||
21 | QRLUser: TQRLabel; |
||
22 | QRLWarning: TQRLabel; |
||
23 | QRLMemo: TQRLabel; |
||
24 | QRMMemo: TQRMemo; |
||
25 | QRSDDate: TQRSysData; |
||
26 | QRSEntete: TQRShape; |
||
27 | DSRelation: TDataSource; |
||
28 | CDSRegles: TClientDataSet; |
||
29 | SFIndex: TStringField; |
||
30 | IFNo: TIntegerField; |
||
31 | SFModeFin: TStringField; |
||
32 | SFConso: TStringField; |
||
33 | QRLRegles: TQRLabel; |
||
34 | QRLNo: TQRLabel; |
||
35 | QRShape2: TQRShape; |
||
36 | QRLModeFin: TQRLabel; |
||
37 | QRLConso: TQRLabel; |
||
38 | QRSDRegles: TQRSubDetail; |
||
39 | QRDBTConso: TQRDBText; |
||
40 | QRDBTNo: TQRDBText; |
||
41 | QRDBTModeFin: TQRDBText; |
||
42 | QRIInraPorc: TQRImage; |
||
43 | QRLInraPorc: TQRLabel; |
||
44 | QRLabel1: TQRLabel; |
||
45 | QRDBText1: TQRDBText; |
||
46 | SFGaspillage: TStringField; |
||
47 | procedure FormCreate(Sender: TObject);
|
||
48 | private
|
||
49 | { D?clarations priv?es }
|
||
50 | public
|
||
51 | { D?clarations publiques }
|
||
52 | end;
|
||
53 | |||
54 | var
|
||
55 | FRapRationP: TFRapRationP; |
||
56 | |||
57 | implementation
|
||
58 | |||
59 | uses
|
||
60 | UStrings, UUtil, UFRationP, UFPrevRap ; |
||
61 | |||
62 | {$R *.dfm}
|
||
63 | |||
64 | { TFRapRationP }
|
||
65 | |||
66 | procedure TFRapRationP.FormCreate(Sender: TObject);
|
||
67 | var
|
||
68 | regle : 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 | Append; |
||
95 | FieldValues['_Ration_'] := FRationP.CBRation.Text;
|
||
96 | Post; |
||
97 | end ;
|
||
98 | QRMMemo.Lines.Add(FRationP.CBRation.Hint); |
||
99 | with CDSRegles do |
||
100 | begin
|
||
101 | CreateDataSet; |
||
102 | for regle := 1 to PRationP.NbRule do |
||
103 | begin
|
||
104 | Append; |
||
105 | FieldValues['_Ration_'] := FRationP.CBRation.Text;
|
||
106 | FieldValues['_No_'] := regle;
|
||
107 | FieldValues['_ModeFin_'] := FRationP.StrModeFin(regle);
|
||
108 | FieldValues['_Conso_'] := FRationP.StrEquation(regle);
|
||
109 | FieldValues['_Gaspillage_'] := Format('%1.0f%%', [PRationP.Rule[regle].Gaspillage * 100]); |
||
110 | Post; |
||
111 | end ;
|
||
112 | end ;
|
||
113 | RegisterPreviewClass(TQRPrevRapInterface); |
||
114 | // QRRapport.PreviewModal;
|
||
115 | // RegisterPreviewClass(TQRStandardPreviewInterface);
|
||
116 | end;
|
||
117 | |||
118 | end. |