Jump to content

Downloading a PDF using a button or Menu option


Servant5166

Recommended Posts

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.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...