home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 August / VPR9608A.BIN / del20try / install / data.z / LABELREP.PAS < prev    next >
Pascal/Delphi Source File  |  1996-05-08  |  2KB  |  62 lines

  1. {*************************************************}
  2. {*  QuickReport for Delphi                       *}
  3. {*  Demo Report LabelRep                         *}
  4. {*                                               *}
  5. {*  Shows how to create mailing label type       *}
  6. {*  reports. Also show a technic to surpress     *}
  7. {*  blank address lines                          *}
  8. {*************************************************}
  9.  
  10. unit Labelrep;
  11.  
  12. interface
  13.  
  14. uses
  15.   SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
  16.   StdCtrls, Quickrep, ExtCtrls, DB, DBTables;
  17.  
  18. type
  19.   TLabelForm = class(TForm)
  20.     Rep: TQuickReport;
  21.     QRBand1: TQRBand;
  22.     QRDBText1: TQRDBText;
  23.     QRDBText2: TQRDBText;
  24.     QRBand2: TQRBand;
  25.     QRLabel1: TQRLabel;
  26.     QRSysData1: TQRSysData;
  27.     Addr1Label: TQRLabel;
  28.     Addr2Label: TQRLabel;
  29.     QRBand3: TQRBand;
  30.     QRLabel2: TQRLabel;
  31.     QRLabel3: TQRLabel;
  32.     Memo1: TMemo;
  33.     procedure QRBand1BeforePrint(var PrintBand: Boolean);
  34.   private
  35.     { Private declarations }
  36.   public
  37.     { Public declarations }
  38.   end;
  39.  
  40. var
  41.   LabelForm: TLabelForm;
  42.  
  43. implementation
  44.  
  45. uses datasets;
  46.  
  47. {$R *.DFM}
  48.  
  49. procedure TLabelForm.QRBand1BeforePrint(var PrintBand: Boolean);
  50. begin
  51.    with CustomerData do begin
  52.    Addr1Label.Caption:=CustomersCity.Value+' '+CustomersZip.Value+' '+CustomersState.Value;
  53.    if CustomersAddr2.Value<>'' then begin
  54.       Addr2Label.Caption:=Addr1Label.Caption;
  55.       Addr1Label.Caption:=CustomersAddr2.value;
  56.    end else Addr2Label.Caption:='';
  57.    end;
  58.  
  59. end;
  60.  
  61. end.
  62.