Quickreport Save PDF by Default

Asked

Viewed 1,556 times

0

My reports always have the Tqrpdffilter component, so they can be exported to PDF.
However the client is complaining that when clicking save, he still has to select the format you want to save (in this case, pdf), as it always comes as QRP.
I wanted to know if there is a way in quickReport for me to set the default option, or better yet, remove the save option in QRP. Does anyone know?

2 answers

2

Resurrecting the topic for future doubts: Change the property PreviewDefaultSaveType from your quickreport to stPDF.

1

used this code in quickreport 3.0 and Delphi 7, I believe it is still working in the most current versions.

   procedure ReportExport(aReport: TQuickRep; const aFileName: TFileName);
    var Pdf: TPdfDocument;
         aMeta: TMetaFile;
         i: integer;
    begin
      Pdf := TPdfDocument.Create;
      try
        aReport.Prepare;
        for i := 1 to aReport.QRPrinter.PageCount do begin
          aMeta := aReport.QRPrinter.GetPage(i);
          try
            Pdf.DefaultPageWidth := MulDiv(aMeta.Width,72,Pdf.ScreenLogPixels);
            Pdf.DefaultPageHeight := MulDiv(aMeta.Height,72,Pdf.ScreenLogPixels);
            Pdf.AddPage;
            // desenha a pagina
            Pdf.Canvas.RenderMetaFile(aMeta,1,0,0);
          finally
            aMeta.Free;
          end;
        end;
        Pdf.SaveToFile(aFileName);
      finally
        Pdf.free;
      end;

So it will export in direct pdf.

  • 1

    This is even interesting... although it’s not what I wanted, maybe it’s an outline

Browser other questions tagged

You are not signed in. Login or sign up in order to post.