home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 February / Chip_2004-02_cd1.bin / program / delphi / navody / d56 / ec1vr2.exe / #setuppath# / Delphi / 2DTable / Rep.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2003-12-09  |  1.0 KB  |  56 lines

  1. unit Rep;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   vivrep20, ComCtrls
  8. {$IFDEF VER140}
  9. , Variants
  10. {$ENDIF}
  11. ;
  12.  
  13. type
  14.   TRepForm = class(TForm)
  15.     VividReport: TVividReport;
  16.     MasterPage: TVRPage;
  17.     VRBand1: TVRBand;
  18.     VRBand2: TVRBand;
  19.     VRBand3: TVRBand;
  20.     SysInfo: TVRLabel;
  21.     RepTitle: TVRLabel;
  22.     Grid: TVRGrid;
  23.     VRBand4: TVRBand;
  24.  
  25.     procedure GridCells3CalcValue(Sender: TObject);
  26.   private
  27.     { Private declarations }
  28.   public
  29.     { Public declarations }
  30.   end;
  31.  
  32. var
  33.   RepForm: TRepForm;
  34.  
  35. implementation
  36.  
  37. uses Dm;
  38.  
  39. {$R *.DFM}
  40.  
  41. procedure TRepForm.GridCells3CalcValue(Sender: TObject);
  42. var 
  43.   ASum: Variant;
  44. begin
  45.   ASum := DModule.RepSumQuery.Lookup ('CustNo;PaymentMethod',
  46.                              VarArrayOf([DModule.RepCustQueryCustNo.Value,
  47.                              DModule.RepMethodsQueryPaymentMethod.Value]),'TotalSum');
  48.  
  49.   if VarIsNull (ASum) then 
  50.     (Sender as TAbsCurrency).Value := 0
  51.   else
  52.     (Sender as TAbsCurrency).Value := ASum;
  53. end;
  54.  
  55. end.
  56.