Alessandro Posted October 2, 2015 Share Posted October 2, 2015 Hi! I created a report generator FastReport in my system. When show (PDF) file, appears in another browser tab. Its ok. It turns out that when the generator creates the report, the file is saved in "UniServerModule.LocalCachePath" site server. I want the report generator to create the file and save this on the local machine of the client, perhaps in a specified folder (I create) or in the customer's own cache folders. How to do this? Thank you. ----------------------------------- Olá! Eu criei um gerador de relatórios em FastReport para meu sistema. Quando mando visualizar o arquivo (PDF), aparece em uma outra aba do browser. Até aí tudo certo. Acontece que, quando o gerador cria o relatório, o arquivo é salvo no local UniServerModule.LocalCachePath, servidor. Eu quero que quando o gerador do relatório criar o arquivo, este salve na maquina local do cliente, talvez numa pasta específica (que eu mande criar) ou nas pastas cache do próprio cliente. Como fazer isso? Obrigado. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted October 2, 2015 Administrators Share Posted October 2, 2015 You can not do this directly. It is against browser security rules. You must use SendFile() to send PDF to user and user will decide where to save it. 1 Link to comment Share on other sites More sharing options...
Alessandro Posted October 2, 2015 Author Share Posted October 2, 2015 understand. Thank you. Link to comment Share on other sites More sharing options...
adragan Posted October 2, 2015 Share Posted October 2, 2015 "I want the report generator to create the file and save this on the local machine of the client, perhaps in a specified" SendFile() does that in the Download folder of your browser. 1 Link to comment Share on other sites More sharing options...
Alessandro Posted October 2, 2015 Author Share Posted October 2, 2015 its working. Thanks Link to comment Share on other sites More sharing options...
Alessandro Posted November 16, 2015 Author Share Posted November 16, 2015 procedure TUniMainModule.MyFrxDownload(frxReport: TfrxReport); var fn:String; FormUrlView1: TFm_Rel; begin fn:= 'R-' + FormatDateTime('hhmmss.zzz', Now()) +'.pdf'; frxReport.PrintOptions.ShowDialog := False; frxReport.ShowProgress:=false; frxReport.PrintOptions.ShowDialog:=false; frxReport.EngineOptions.SilentMode:=True; frxPDFExport.Background:=True; frxPDFExport.ShowProgress:=False; frxPDFExport.ShowDialog:=False; frxPDFExport.FileName := UniServerModule.LocalCachePath + fn; frxPDFExport.DefaultPath := ''; frxReport.PrepareReport(); frxReport.Export(frxPDFExport); UniSession.SendFile(UniServerModule.LocalCachePath + fn, fn); FormUrlView1 := TFm_Rel.Create(UniApplication); FormUrlView1.uniURLFrame1.URL := UniServerModule.LocalCacheURL + fn; FormUrlView1.Show; end; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now