Jump to content

SAVE FILE REPORT ON LOCAL MACHINE [solved]


Alessandro

Recommended Posts

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

  • 1 month later...
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...