Jump to content
uniGUI Discussion Forums
Sign in to follow this  

Downloading a PDF using a button or Menu option

Recommended Posts



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 and Delphi 10.2.


Thanks in advance.

Share this post

Link to post
Share on other sites



Use UniSession.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;
   lPDFDevice:  TppPDFDevice;
      lPDFDevice := TppPDFDevice.Create(nil);
      lPDFDevice.PDFSettings := Reports.PDFSettings;
      lPDFDevice.FileName    := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', Result, True);
      lPDFDevice.Publisher   := Reports.Publisher;
      // generate the report
Thank you.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this