如何获取报表页数?(20分)

  • 主题发起人 主题发起人 yanzhong
  • 开始时间 开始时间
Y

yanzhong

Unregistered / Unconfirmed
GUEST, unregistred user!
QuickReport1.Prepare;
qrPage.Caption:=inttostr( QuickReport1.QRPrinter.PageNumber);
QuickReport1.QRPrinter.Free;
QuickReport1.QRPrinter:=nil;
QuickReport1.Preview;
用上面的代码后,预览是空的,实际有三页的东西
 
QuickReport1.Prepare;
qrPage.Caption:=inttostr( QuickReport1.QRPrinter.PageNumber);
//删除这行 QuickReport1.QRPrinter.Free;

//删除这行 QuickReport1.QRPrinter:=nil;
QuickReport1.Preview;
 
free、nil后肯定什么都没有了
 
try
QuickReport1.Prepare;
qrPage.Caption:=inttostr( QuickReport1.QRPrinter.PageNumber);
QuickReport1.Preview;
finally
QuickReport1.QRPrinter.Free;
QuickReport1.QRPrinter:=nil;
end;
 

Similar threads

后退
顶部