FastReport 에서 미리보기를 하지 않고 곧바로 PDF로 출력하기
당연히 FRXReport 콤포넌트에서 출력 폼을 먼저 생성하여야 하겠지요 (*.fr3)
procedure TForm1.ExportToPDF(AReport: TfrxReport; AFileName: String);
var
PDFExport: TfrxPDFExport;
begin
PDFExport := TfrxPDFExport.Create(nil);
try
PDFExport.ShowProgress := True;
if AFileName <> '' then begin
PDFExport.ShowDialog := False;
PDFExport.FileName := AFileName;
end;
AReport.PrepareReport(True);
AReport.Export(PDFExport);
finally PDFExport.Free;
end;
end;
var
PDFExport: TfrxPDFExport;
begin
PDFExport := TfrxPDFExport.Create(nil);
try
PDFExport.ShowProgress := True;
if AFileName <> '' then begin
PDFExport.ShowDialog := False;
PDFExport.FileName := AFileName;
end;
AReport.PrepareReport(True);
AReport.Export(PDFExport);
finally PDFExport.Free;
end;
end;
댓글 없음:
댓글 쓰기