Jump to content


Photo

Downloading a PDF using a button or Menu option


  • Please log in to reply
3 replies to this topic

#1 Servant5166

Servant5166

    Member

  • uniGUI Subscriber
  • PipPip
  • 19 posts

Posted 06 January 2018 - 09:53 AM

Hi,

 

I'm using ReportBuilder 18, and I need an option to download PDF's to the user's machine instead of displaying the report. How do I accomplish this?

 

I'm using uniGUI 1.0.0.1420 and Delphi 10.2.

 

Thanks in advance.


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3855 posts

Posted 06 January 2018 - 09:59 AM

Hi,

 

Use UniSession.SendFile

\FMSoft\Framework\uniGUI\Demos\Desktop\SendFile

Best regards,


  • 0

#3 Servant5166

Servant5166

    Member

  • uniGUI Subscriber
  • PipPip
  • 19 posts

Posted 06 January 2018 - 06:04 PM

Hi,

 

Use UniSession.SendFile

\FMSoft\Framework\uniGUI\Demos\Desktop\SendFile

Best regards,

I'm not sure on how to do it. I would like a save dialog box to prompt the user for filename and location.

 

Here's my code to create the PDF below

 

function TrepDataModule.GenRep(ID: Integer; ReportName: string): string;
var
   lPDFDevice:  TppPDFDevice;
begin
      lPDFDevice := TppPDFDevice.Create(nil);
      lPDFDevice.PDFSettings := Reports.PDFSettings;
      lPDFDevice.FileName    := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', Result, True);
      lPDFDevice.Publisher   := Reports.Publisher;
      // generate the report
      Reports.PrintToDevices;
   finally
      lPDFDevice.Free;
   end;
end;
 
Thank you.

  • 0

#4 Servant5166

Servant5166

    Member

  • uniGUI Subscriber
  • PipPip
  • 19 posts

Posted 08 January 2018 - 02:32 PM

Let me try something before I ask for your help


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users