I need run a report (TQuickRep) for export only, without printing or showing. The Prepare method does nothing. The beforeprints or afterprints events doesn´t fires.
Ex.
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;
This should work for you...( I was looking for a solution just like this and the code below worked for me.)