你的数据是用数组、文件、全局结构变量传给报表?
procedure TfrmNeedData.FormCreate(Sender: TObject);
var
i: integer;
begin
SomeList := TStringlist.Create;
for i := 0 to 500do
SomeList.Add('Line ' + IntToStr(i));
end;
procedure TfrmNeedData.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
CurrentIndex := 0;
end;
procedure TfrmNeedData.QuickRep1NeedData(Sender: TObject;
var MoreData: Boolean);
begin
// If MoreData is true, then
QuickReport will print
// another detail band. When you set it to false,
// the report isdo
ne.
MoreData := (CurrentIndex < SomeList.Count);
if MoreData then
begin
QRLabel1.Caption := SomeList[CurrentIndex];
// Here's how to set the progress bar
QuickRep1.QRPrinter.Progress := (Longint(CurrentIndex) * 100) div SomeList.Count;
end
else
QuickRep1.QRPrinter.Progress := 100;
Inc(CurrentIndex);
end;
此例 的数据赋值: QRLabel1.Caption := SomeList[CurrentIndex];
数据来源:SomeList[CurrentIndex];
判断数据处理结束 :MoreData := (CurrentIndex < SomeList.Count);
按你的意思: QRLabel1的个数可能不固定,宽度也未知,只能态调整。