unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
FR_DSet, FR_Class;
type
TForm2 = class(TForm)
frReport1: TfrReport;
frUserDataset1: TfrUserDataset;
procedure frUserDataset1CheckEOF(Sender: TObject; var Eof: Boolean);
procedure frUserDataset1First(Sender: TObject);
procedure frUserDataset1Next(Sender: TObject);
procedure frUserDataset1Prior(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure frReport1GetValue(const ParName: String;
var ParValue: Variant);
private
{ Private declarations }
Fa: array [0..1, 0..2] of integer;
FRow: Integer;
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
procedure TForm2.frUserDataset1CheckEOF(Sender: TObject; var Eof: Boolean);
begin
Eof := FRow = 2;
end;
procedure TForm2.frUserDataset1First(Sender: TObject);
begin
FRow := 0;
end;
procedure TForm2.frUserDataset1Next(Sender: TObject);
begin
Inc(FRow);
end;
procedure TForm2.frUserDataset1Prior(Sender: TObject);
begin
Dec(FRow);
end;
procedure TForm2.FormCreate(Sender: TObject);
var
i, j, k: Integer;
begin
k := 0;
for i := 0 to 1 do
for j := 0 to 2 do
begin
fa[i,j] := k;
Inc(k);
end;
end;
procedure TForm2.frReport1GetValue(const ParName: String;
var ParValue: Variant);
begin
if ParName = 'a0' then
ParValue := Fa[FRow, 0]
else if ParName = 'a1' then
ParValue := Fa[FRow, 1]
else if ParName = 'a2' then
ParValue := Fa[FRow, 2];
end;
end.