home *** CD-ROM | disk | FTP | other *** search
/ Delphi Anthology / aDELPHI.iso / Runimage / Delphi50 / Demos / Quickrpt / Qr3 / frmltr.pas < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  2KB  |  67 lines

  1. { :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2.   :: QuickReport 3.0 for Delphi 3.0/4.0/5.0                  ::
  3.   ::                                                         ::
  4.   :: Simple report for doing a form letter                   ::
  5.   ::                                                         ::
  6.   :: Copyright (c) 1995-1999 QuSoft AS                       ::
  7.   :: All Rights Reserved                                     ::
  8.   ::                                                         ::
  9.   :: web: http://www.qusoft.com  fax: +47 22 41 74 91        ::
  10.   ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }
  11. unit frmltr;
  12.  
  13. interface
  14.  
  15. uses
  16.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  17.   Db, DBTables, ExtCtrls, QuickRpt, Qrctrls;
  18.  
  19. type
  20.   TfrmFormLetter = class(TForm)
  21.     QuickRep1: TQuickRep;
  22.     qryEmployee: TQuery;
  23.     DetailBand1: TQRBand;
  24.     qryEmployeeEmpNo: TIntegerField;
  25.     qryEmployeeLastName: TStringField;
  26.     qryEmployeeFirstName: TStringField;
  27.     qryEmployeePhoneExt: TStringField;
  28.     qryEmployeeHireDate: TDateTimeField;
  29.     qryEmployeeSalary: TFloatField;
  30.     QRExprMemo1: TQRExprMemo;
  31.     PageHeaderBand1: TQRBand;
  32.     QRSysData1: TQRSysData;
  33.     procedure DetailBand1BeforePrint(Sender: TQRCustomBand;
  34.       var PrintBand: Boolean);
  35.     procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;
  36.       var PrintReport: Boolean);
  37.   private
  38.     { Private declarations }
  39.     FirstDetail: boolean;
  40.   public
  41.     { Public declarations }
  42.   end;
  43.  
  44. var
  45.   frmFormLetter: TfrmFormLetter;
  46.  
  47. implementation
  48.  
  49. {$R *.DFM}
  50.  
  51. procedure TfrmFormLetter.DetailBand1BeforePrint(Sender: TQRCustomBand;
  52.   var PrintBand: Boolean);
  53. begin
  54.   if FirstDetail then
  55.     FirstDetail := False
  56.   else
  57.     QuickRep1.NewPage;
  58. end;
  59.  
  60. procedure TfrmFormLetter.QuickRep1BeforePrint(Sender: TCustomQuickRep;
  61.   var PrintReport: Boolean);
  62. begin
  63.   FirstDetail := True;
  64. end;
  65.  
  66. end.
  67.