高手帮忙啊 FASTREPORT 的数组作为数据源问题,请看,我现在在公司加班,可怜.....(40分)

  • 主题发起人 主题发起人 wyismail
  • 开始时间 开始时间
W

wyismail

Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
FR_DSet, FR_Class, StdCtrls;
type
TForm1 = class(TForm)
frReport1: TfrReport;
frUserDataset1: TfrUserDataset;
Button1: TButton;
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);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
Fa: array [0..1, 0..2] of integer;
FRow: Integer;
public
{ Public declarations }
end;

var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.frUserDataset1CheckEOF(Sender: TObject;
var Eof: Boolean);
begin
Eof := FRow = 2;
end;

procedure TForm1.frUserDataset1First(Sender: TObject);
begin
FRow := 0;
end;

procedure TForm1.frUserDataset1Next(Sender: TObject);
begin
Inc(FRow);
end;

procedure TForm1.frUserDataset1Prior(Sender: TObject);
begin
Dec(FRow);
end;

procedure TForm1.FormCreate(Sender: TObject);
var
i, j, k: Integer;
begin
k := 0;
for i := 0 to 1do
for j := 0 to 2do
begin
fa[i,j] := k;
Inc(k);
end;
end;

procedure TForm1.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;

procedure TForm1.Button1Click(Sender: TObject);
begin
//frUserDataset1.RangeEndCount :=2;
//frUserDataset2.RangeEndCount := Table1.FieldCount;
self.frReport1.Preview:=nil;
self.frReport1.ShowReport;
end;

end.
现象是不出现报表, 没分了啊
 
你把StoreInDFM设置为true试试看
 
接受答案了.
 

Similar threads

后退
顶部