Alessandro Posted May 18, 2017 Share Posted May 18, 2017 Good Morning! I have a very strange problem! I have 1 application (.exe) running on the server. I have 2 database (independent, but equal) using the same application. I use 2 different browsers with different IP to access the server application. As the initial login, I direct the user to use X or Y database. Records and consultations work perfect. So far so good. Problem: When I generate a report using an database X, if I generate the same report using the database Y in another different browser and IP, the report X the data showing in the report Y! To generate the report, I use a procedure in Firebird (with parameters), a data module with DataSet / DataSource and FastReport. Can anyone help me clarify what's going on? Thank you. Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted May 18, 2017 Share Posted May 18, 2017 Alessandro, FastReport tem esse problema, verifique as seguintes condições quando voce cria os relatórios: -- FastReport has this problem, check the following conditions when you create the reports: frxReport.EngineOptions.DestroyForms := False; frxReport.EngineOptions.UseGlobalDataSetList := False; frxReport.EngineOptions.EnableThreadSafe := True; frxReport.PreviewOptions.AllowEdit := False; e procurer gerar os relatórios sempre com nomes diferentes ex: -- And seek to generate reports always with different names eg: frxPDF.DefaultPath := REL_+FormatDateTime('_[HHMMSSZZZ]', Now)+'.pdf'; 1 Quote Link to comment Share on other sites More sharing options...
Alessandro Posted May 18, 2017 Author Share Posted May 18, 2017 Alessandro, FastReport tem esse problema, verifique as seguintes condições quando voce cria os relatórios: -- FastReport has this problem, check the following conditions when you create the reports: frxReport.EngineOptions.DestroyForms := False; frxReport.EngineOptions.UseGlobalDataSetList := False; frxReport.EngineOptions.EnableThreadSafe := True; frxReport.PreviewOptions.AllowEdit := False; e procurer gerar os relatórios sempre com nomes diferentes ex: -- And seek to generate reports always with different names eg: frxPDF.DefaultPath := REL_+FormatDateTime('_[HHMMSSZZZ]', Now)+'.pdf'; Marlon... Eu fiz dessa forma aqui e os dados se misturam. procedure TUniMainModule.MyFrxShowV2(NomeRelatorio, TituloDoRelatorio, TituloFormulario : String); var fn, Aurl: String; FormUrlView1: TFm_Relatorio; RelRep : TfrxReport; begin DmCadastro.AbreFechaLoja(0); RelRep := TfrxReport.Create(nil); try fn := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', AUrl); RelRep.LoadFromFile(extractFilePath(Application.Exename) + '\Relatorios\' + nomerelatorio); RelRep.ShowProgress := False; RelRep.PrintOptions.ShowDialog := False; RelRep.PreviewOptions.AllowEdit := False; RelRep.EngineOptions.SilentMode := True; // no dialogs RelRep.EngineOptions.EnableThreadSafe := True; // Thread safety RelRep.EngineOptions.DestroyForms := False; // Needed for correct operation RelRep.EngineOptions.UseGlobalDataSetList := False; // Do not keep a global list of a datasets frxPDFExport.Background := true; frxPDFExport.ShowProgress := False; frxPDFExport.ShowDialog := False; frxPDFExport.FileName := fn; frxPDFExport.DefaultPath := ''; RelRep.PrepareReport(); // Cria report RelRep.Export(frxPDFExport); // Exporta Report FormUrlView1 := TFm_Relatorio.Create(UniApplication); FormUrlView1.uniURLFrame1.URL := Aurl; FormUrlView1.Show; finally RelRep.Free; end; TrimAppMemorySize(); end; Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted May 18, 2017 Share Posted May 18, 2017 A variável AbreFechaLoja(0) você busca de onde? -- The variable OpenFakeStore (0) you search from where? Você chegou a verificar no servidor, se os relatórios gerados por ambos os clientes se são gerados diferente? -- Did you get to check on the server if the reports generated by both clients are generated differently?Enviado de meu XT1563 usando Tapatalk Quote Link to comment Share on other sites More sharing options...
Alessandro Posted May 19, 2017 Author Share Posted May 19, 2017 Oi Marlon, A variável AbreFechaLoja(0) está desativada. Não funciona (já foi removida). Quanto aos PDFs, quando gerados, ambos saem iguais. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.