unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, QuickRpt, ExtCtrls, QRCtrls, DB, ADODB;
type
TForm1 = class(TForm)
QuickRep1: TQuickRep;
Button1: TButton;
ADODataSet1: TADODataSet;
ADODataSet1a: TStringField;
DetailBand1: TQRBand;
ChildBand1: TQRChildBand;
QRDBText1: TQRDBText;
ADODataSet2: TADODataSet;
ADODataSet2a: TStringField;
QRDBText2: TQRDBText;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ADODataSet1AfterScroll(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
QuickRep1.Preview;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
ADODataSet1.CreateDataSet;
for i := 1 to 20do
ADODataSet1.AppendRecord(['ADODataSet1_' + inttostr(i)]);
ADODataSet2.CreateDataSet;
for i := 1 to 20do
ADODataSet2.AppendRecord(['ADODataSet2_' + inttostr(i)]);
ADODataSet2.First;
end;
procedure TForm1.ADODataSet1AfterScroll(DataSet: TDataSet);
begin
ADODataSet2.RecNo := DataSet.RecNo
end;
end.
object Form1: TForm1
Left = 192
Top = 107
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Scaled = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object QuickRep1: TQuickRep
Left = 248
Top = 88
Width = 794
Height = 1123
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
DataSet = ADODataSet1
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
Functions.Strings = (
'PAGENUMBER'
'COLUMNNUMBER'
'REPORTTITLE'
'QRSTRINGSBAND1')
Functions.DATA = (
'0'
'0'
''''''
'''''')
Options = [FirstPageHeader, LastPageFooter]
Page.Columns = 1
Page.Orientation = poPortrait
Page.PaperSize = A4
Page.Values = (
100
2970
100
2100
100
100
0)
PrinterSettings.Copies = 1
PrinterSettings.Duplex = False
PrinterSettings.FirstPage = 0
PrinterSettings.LastPage = 0
PrinterSettings.OutputBin = Auto
PrintIfEmpty = True
SnapToGrid = True
Units = MM
Zoom = 100
object DetailBand1: TQRBand
Left = 38
Top = 38
Width = 718
Height = 40
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
105.833333333333
1899.70833333333)
BandType = rbDetail
object QRDBText1: TQRDBText
Left = 48
Top = 16
Width = 8
Height = 17
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
44.9791666666667
127
42.3333333333333
21.1666666666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataSet = ADODataSet1
DataField = 'a'
Transparent = False
WordWrap = True
FontSize = 10
end
end
object ChildBand1: TQRChildBand
Left = 38
Top = 78
Width = 718
Height = 40
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
105.833333333333
1899.70833333333)
ParentBand = DetailBand1
object QRDBText2: TQRDBText
Left = 104
Top = 16
Width = 8
Height = 17
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
44.9791666666667
275.166666666667
42.3333333333333
21.1666666666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Color = clWhite
DataSet = ADODataSet2
DataField = 'a'
Font.Charset = DEFAULT_CHARSET
Font.Color = clGreen
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
Transparent = False
WordWrap = True
FontSize = 10
end
end
end
object Button1: TButton
Left = 16
Top = 32
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 1
OnClick = Button1Click
end
object ADODataSet1: TADODataSet
AfterScroll = ADODataSet1AfterScroll
Parameters = <>
Left = 104
Top = 120
object ADODataSet1a: TStringField
FieldName = 'a'
end
end
object ADODataSet2: TADODataSet
Parameters = <>
Left = 112
Top = 208
object ADODataSet2a: TStringField
FieldName = 'a'
end
end
end