unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, QuickRpt, QRCtrls, ExtCtrls, DB, DBTables;
type
TForm1 = class(TForm)
Table1: TTable;
QuickRep1: TQuickRep;
QRBand2: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure QRBand2BeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
procedure QRBand2AfterPrint(Sender: TQRCustomBand; BandPrinted: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i: Integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
i := 0;
QuickRep1.Preview;
end;
procedure TForm1.QRBand2AfterPrint(Sender: TQRCustomBand; BandPrinted: Boolean);
begin
if i mod 5 = 0 then
QuickRep1.NewPage;
end;
procedure TForm1.QRBand2BeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
Inc(i);
end;
end.
the form
object Form1: TForm1
Left = 245
Top = 92
Caption = 'Form1'
ClientHeight = 464
ClientWidth = 854
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Scaled = False
PixelsPerInch = 96
TextHeight = 13
object QuickRep1: TQuickRep
Left = 76
Top = 54
Width = 794
Height = 1123
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
DataSet = Table1
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
Functions.Strings = (
'PAGENUMBER'
'COLUMNNUMBER'
'REPORTTITLE')
Functions.DATA = (
'0'
'0'
#39#39)
Options = [FirstPageHeader, LastPageFooter]
Page.Columns = 1
Page.Orientation = poPortrait
Page.PaperSize = A4
Page.Values = (
100.000000000000000000
2970.000000000000000000
100.000000000000000000
2100.000000000000000000
100.000000000000000000
100.000000000000000000
0.000000000000000000)
PrinterSettings.Copies = 1
PrinterSettings.OutputBin = Auto
PrinterSettings.Duplex = False
PrinterSettings.FirstPage = 0
PrinterSettings.LastPage = 0
PrinterSettings.UseStandardprinter = False
PrinterSettings.UseCustomBinCode = False
PrinterSettings.CustomBinCode = 0
PrinterSettings.ExtendedDuplex = 0
PrinterSettings.UseCustomPaperCode = False
PrinterSettings.CustomPaperCode = 0
PrinterSettings.PrintMetaFile = False
PrinterSettings.PrintQuality = 0
PrinterSettings.Collate = 0
PrinterSettings.ColorOption = 0
PrintIfEmpty = True
SnapToGrid = True
Units = MM
Zoom = 100
PrevFormStyle = fsNormal
PreviewInitialState = wsNormal
PrevInitialZoom = qrZoomToFit
object QRBand2: TQRBand
Left = 38
Top = 38
Width = 718
Height = 40
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AfterPrint = QRBand2AfterPrint
AlignToBottom = False
BeforePrint = QRBand2BeforePrint
Color = clWhite
TransparentBand = False
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
105.833333333333300000
1899.708333333333000000)
PreCaluculateBandHeight = False
KeepOnOnePage = False
BandType = rbDetail
object QRDBText1: TQRDBText
Left = 18
Top = 12
Width = 44
Height = 17
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
44.979166666666670000
47.625000000000000000
31.750000000000000000
116.416666666666700000)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataSet = Table1
DataField = 'CustNo'
Transparent = False
WordWrap = True
FontSize = 10
end
object QRDBText2: TQRDBText
Left = 104
Top = 12
Width = 56
Height = 17
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
44.979166666666670000
275.166666666666700000
31.750000000000000000
148.166666666666700000)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataSet = Table1
DataField = 'Company'
Transparent = False
WordWrap = True
FontSize = 10
end
object QRDBText3: TQRDBText
Left = 454
Top = 11
Width = 24
Height = 17
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
44.979166666666670000
1201.208333333333000000
29.104166666666670000
63.500000000000000000)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataSet = Table1
DataField = 'City'
Transparent = False
WordWrap = True
FontSize = 10
end
end
end
object Button1: TButton
Left = 10
Top = 12
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 1
OnClick = Button1Click
end
object Table1: TTable
Active = True
DatabaseName = 'DBDEMOS'
TableName = 'customer.db'
Left = 228
Top = 120
end
end
|