1

我只需要为导出运行报告 (TQuickRep),无需打印或显示。Prepare 方法什么都不做。beforeprints 或 afterprints 事件不会触发。

前任。

var rep: TMyQuickRep; //TMyQuickRep is a report TQuickRep
begin
  rep := TMyQuickRep.Create(Self);
  try
    rep.SomeData := somedata;
    rep.DataSet  := somDataSet;
    rep.Prepare;
    //rep.Run? there isn´t a method for run
    rep.ExportToFilter(TQRPDFDocumentFilter.Create('c:\temp\myreport.pdf'));  
    //pdf is an empty page
  finally
    FreeAndNil(rep);
  end;
end;
4

1 回答 1

1

这应该对你有用......(我一直在寻找这样的解决方案,下面的代码对我有用。)

rep.ExportToFilter(TQRPDFDocumentFilter.Create('c:\temp\myreport.pdf')); 
rep.Print;
于 2020-11-09T21:27:40.163 回答