如何将二维数组内容通过FASTREPORT报表控件输出,急急(100分)

  • 主题发起人 主题发起人 hjy2000
  • 开始时间 开始时间
H

hjy2000

Unregistered / Unconfirmed
GUEST, unregistred user!
最好给出原码,感谢
 
给个方向:
根据2维数珠循环,动态创建qrlabel和位置
 
能讲细些吗?用ongetvalue事件如何实现?thx
是用fastreport
 
var
str:string;
f1:TQRlabel;
xxxx,yyy,i,j,top,left:integer;
begin
for i:=1 to xxxx do
begin
f1=TQRlabel.Create(nil);
f1.Parent:=querrep;
f1.Top:=top;
for j:=1 to yyy do
begin
str:=arrayx(i,j);
f1.Left:=f1.Left+20;
f1.Caption:=str;
end;
top:=top+20;
end;
end;
简单描述。
 
可fastreport中无TQRlabel呀!!
在FASTREPORT中如何实现?
 
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.
 
to:whf
谢谢指点。试拉一下,可以实现。只是在跟踪FRUSERDATASET的事件顺序时
发现CHECKEOF事件每次都连续执行2次,为何,我的FSATREPORT版本是2。41C
再请教如何在程序中控制FASTREPORT报表纸张?谢谢
另:whf是Report Machine作者呀,高手,多指教。
 
frReport1.Pages[0].ChangePage
 
谢谢各位
 

Similar threads

S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
922
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部