Jump to content

Zazhir

Members
  • Content Count

    39
  • Joined

  • Last visited

Everything posted by Zazhir

  1. Thanks for the help everyone!! 😄 quick update here: I've solved the problem!! What I has to do is just create a new component in every button (belive that's not the more efficent way, but it is the more simple that I found). just like that: procedure TfrmExportarImovel.btnPdfClick(Sender: TObject); var Excel: variant; caminho, caminhoFicha, pastaFicha, edtCaminhoRelatorio: string; linha: integer; savePdf: TSaveDialog; //new component created begin try savePdf:= TSaveDialog.Create(Self); //using a fresh and new component if savePdf.Execute then //.... except on E: Exception do begin ShowMessage(E.Message); end; end; end; Have done this for all the buttons that i use to export. 😉
  2. Zazhir

    Corean write in explorer popup menu

    I have a complete delphi application using tatuk and a lot of components. When i use a OpenDialog to call or search to a file in the Windows Explorer, and I give a right click in the mouse button the follow popup is showed. I bilieve that the write is corean or japanese, but I really don't know why this language is displayed, since the Windows native language that I'am using to the aplication and to my PC is Portuguese. Any help to what is going on here and how can I fix it?
  3. Zazhir

    Corean write in explorer popup menu

    Is not my machine, this happen in every server that a upload my application... seens to be like a setting code issue.
  4. Zazhir

    Corean write in explorer popup menu

    indeed a have multiples *dcu files generating when I run the application... but they look like this... not sure if is this the problem...
  5. Zazhir

    Corean write in explorer popup menu

    not clearly, where can I found it this dcu-to-resources-strings? and when you say to use the ".inc"/".pas" files, I just need to recompile it?
  6. Zazhir

    Corean write in explorer popup menu

    The component that I'am using is the TJvOpenDialog in his 3.48 version, when i test it without compile the application, the language appers correctly. But when I click it on the application running, the image is=t is what appers. This is the code tha I use to open the explorer if not TJvOpenDialog1.Execute then exit; //stuff goes here
  7. Zazhir

    Corean write in explorer popup menu

    It is, the application is from 2006... I'am using delphi 2014 to compile it. You know how can I fix it?
  8. I have a button that generate multiples reports acccording to a qry (the same report, but differets data). I'am trying to clean temporary memory after generete the report. All the calls to fastReport is inside a loop while (while qry not .Eof - generate the report). The problem is that sometimes, can be like more than 2000 thousands reports, that's gonna be saved in a specfic folder (pdf type). When i open the task maneger, is possible to see that my delphi applicaton, increase the use of memory a lot. Is there a code to clean the memory after the report is generated? How can i clean this memory after the reports is genereted? //start while //do some stuf //call for the report RelatorioFastReport.frxPDFExport1.FileName := qryPesq.FieldByName('IMOV_ID_CODPREF').asString+'.pdf'; RelatorioFastReport.frxPDFExport1.DefaultPath := frmSIG.dlgFilePDF.FileName; RelatorioFastReport.frxPDFExport1.ShowDialog := False; RelatorioFastReport.frxPDFExport1.ShowProgress := False; RelatorioFastReport.frxPDFExport1.OverwritePrompt := False; RelatorioFastReport.frxAumImovel.LoadFromFile(path+'RelAumImovel.fr3'); RelatorioFastReport.frxAumImovel.PrepareReport(); RelatorioFastReport.frxAumImovel.Export(RelatorioFastReport.frxPDFExport1); RelatorioFastReport.frxAumImovel := nil; RelatorioFastReport.Close; qryPesq.Next; //try to clean memory, without luck if Win32Platform = VER_PLATFORM_WIN32_NT then SetProcessWorkingSetSize(GetCurrentProcess, $FFFFFFFF, $FFFFFFFF); RelatorioFastReport.frxAumImovel.Clear; //end while The reports are indeed being generate, but if a have a lot of then, this error apper in my delphi applicaation https://www.technewstoday.com/not-enough-memory-resources-are-available-to-process-this-command/. How can i fix it?
  9. This is the error that i got, It is in portuguese because is my birth language
  10. Yes, this code is for generate a multiples reports of house increase area with the picture of it geolocated. The code works, but generate like 500 reports than gives a error of memory space (not HD memory).
  11. while not qryPesq.Eof do begin try //Scope no Lote e Imóvel que foi selecionado. for i := 0 to frmSIG.SIG.Items.Count - 1 do begin if not (TGIS_LayerAbstract(frmSIG.SIG.Items[i]) is TGIS_LayerPixel) then TGIS_LAYERVECTOR(frmSIG.SIG.Items[i]).DeselectAll; end; geo_layer_vector:= TGIS_LayerVector( frmsig.SIG.Get('Imovel.legt') ); if not Assigned(geo_layer_vector) then begin showMessage('O layer Imóvel não está aberto. Operação cancelada.'); Exit; end; geo_layer_vector.Scope := 'IMOV_ID_CODPREF = ' +#39+ qryPesq.FieldByName('IMOV_ID_CODPREF').asString+#39; geo_layer_vector:= TGIS_LayerVector( frmsig.SIG.Get('Piscina.legt') ); if not Assigned(geo_layer_vector) then begin showMessage('O layer Piscina não está aberto. Operação cancelada.'); Exit; end; geo_layer_vector.Scope := 'PISC_ID_CODPREF = ' +#39+ qryPesq.FieldByName('IMOV_ID_CODPREF').asString+#39; frmSIG.SIG.Refresh; geo_layer_vector:= TGIS_LayerVector( frmsig.SIG.Get('Lote.legt') ); if not Assigned(geo_layer_vector) then begin showMessage('O layer Lote não está aberto. Operação cancelada.'); Exit; end; geo_layer_vector.Scope := 'LOTE_ID_INSCRICAO = ' +#39+ qryPesq.FieldByName('IMOV_ID_CODPREF').asString+#39; frmSIG.SIG.Refresh; case geo_layer_vector.DefaultShapeType of gisShapeTypePolygon: begin qryUID := TADOQuery.create(self); qryUID.connection := frmSIG.ADOConnection1; qryUID.Close; qryUID.SQL.text := 'Select GID from Lote_FEA where LOTE_ID_INSCRICAO = '+#39+qryPesq.FieldByName('IMOV_ID_CODPREF').AsString+#39; qryUID.Open; geo_shape_Polygon := TGIS_ShapePolygon(geo_layer_vector.GetShape(qryUID.FieldByName('GID').AsInteger)); if geo_shape_Polygon <> nil then begin geo_shape_Polygon := TGIS_ShapePolygon(geo_layer_vector.GetShape(qryUID.FieldByName('GID').AsInteger) .MakeEditable); geo_shape := geo_shape_Polygon; coordenadas.XMax := geo_shape.Extent.XMax + 10; coordenadas.YMax := geo_shape.Extent.YMax + 10; coordenadas.XMin := geo_shape.Extent.XMin - 10; coordenadas.YMin := geo_shape.Extent.YMin - 10; end; end; end; //Centraliza a tela para tirar a foto do Croqui frmSIG.SIG.VisibleExtent := coordenadas; frmSIG.SIG.Center := geo_shape.Centroid; //Cria uma pasta chamada "Croqui" dentro da pasta de fotos do Imóvel e exporta. if not DirectoryExists(frmSIG.fotoImovel+'\Croqui') then MkDir(frmSIG.fotoImovel+'\Croqui'); geo_extend.XMax := frmSIG.SIG.VisibleExtent.XMax + 10; geo_extend.YMax := frmSIG.SIG.VisibleExtent.YMax + 10; geo_extend.XMin := frmSIG.SIG.VisibleExtent.XMin - 10; geo_extend.YMin := frmSIG.SIG.VisibleExtent.YMin - 10; frmSig.SIG.ExportToImage(frmSIG.fotoImovel+'\Croqui\'+qryPesq.FieldByName('IMOV_ID_CODPREF').asString+'.jpg',geo_extend,1024,768,90,0,96); //Limpa o Scope de Lote e Imóvel para voltar o mapa normal geo_layer_vector:= TGIS_LayerVector( frmsig.SIG.Get('Imovel.legt') ); geo_layer_vector.Scope := ''; geo_layer_vector:= TGIS_LayerVector( frmsig.SIG.Get('Lote.legt') ); geo_layer_vector.Scope := ''; frmSIG.SIG.Refresh; if not Assigned(RelatorioFastReport) then RelatorioFastReport := TRelatorioFastReport.Create(self); path := ExtractFilePath(Application.ExeName); RelatorioFastReport.qryAumImovel.Close; RelatorioFastReport.qryAumImovel.SQL.Text := 'Select Lote_FEA.*, Imovel_FEA.*,(Imovel_FEA.IMOV_NR_AREA_CONSTRUIDA_PREF * 1.1) as DezPorCento '+ 'from Imovel_FEA inner join Lote_FEA '+ 'on Imovel_FEA.IMOV_ID_CODPREF = Lote_FEA.LOTE_ID_INSCRICAO '+ 'where Imovel_FEA.IMOV_ID_CODPREF = '+#39+qryPesq.FieldByName('IMOV_ID_CODPREF').asString+#39+' and IMOV_TX_TIPO_IMOVEL = '+#39+'PRINCIPAL'+#39; RelatorioFastReport.qryAumImovel.Open; RelatorioFastReport.frxPDFExport1.FileName := qryPesq.FieldByName('IMOV_ID_CODPREF').asString+'.pdf'; RelatorioFastReport.frxPDFExport1.DefaultPath := frmSIG.dlgFilePDF.FileName; RelatorioFastReport.frxPDFExport1.ShowDialog := False; RelatorioFastReport.frxPDFExport1.ShowProgress := False; RelatorioFastReport.frxPDFExport1.OverwritePrompt := False; RelatorioFastReport.frxAumImovel.LoadFromFile(path+'RelAumImovel.fr3'); RelatorioFastReport.frxAumImovel.PrepareReport(); RelatorioFastReport.frxAumImovel.Export(RelatorioFastReport.frxPDFExport1); RelatorioFastReport.frxAumImovel := nil; RelatorioFastReport.Close; qryPesq.Next; //deleta todos os arquivos com extensão de desenho try filesDirectory := frmSIG.fotoImovel+'\Croqui'; FindFirst(filesDirectory + '\*.tab', faAnyFile, SearchRec); repeat DeleteFile(filesDirectory + '\' + SearchRec.name); until FindNext(SearchRec) <> 0; finally FindClose(SearchRec); end; //deleta todos os arquivos com extensão de desenho try filesDirectory := frmSIG.fotoImovel+'\Croqui'; FindFirst(filesDirectory + '\*.JGW', faAnyFile, SearchRec); repeat DeleteFile(filesDirectory + '\' + SearchRec.name); until FindNext(SearchRec) <> 0; finally FindClose(SearchRec); end; //deleta todos os arquivos com extensão de desenho try filesDirectory := frmSIG.fotoImovel+'\Croqui'; FindFirst(filesDirectory + '\*.jpg.prj', faAnyFile, SearchRec); repeat DeleteFile(filesDirectory + '\' + SearchRec.name); until FindNext(SearchRec) <> 0; finally FindClose(SearchRec); end; except on E: Exception do begin ShowMessage('Algo deu errado na geração de notificação!' + #13 + E.Message); abort end; end; end; //maximiza a tela apos gerar todos... frmSIG.WindowState := wsMaximized; So, as i explain before, the thing is inside my loop. I've found that deleting some files that are generete to be send to inside the report, decrease the use of memory, after generete the .jpg and send to the report, i delete some others files that are genereted in the same time. Other thing is that I minimezed the window, read about that doing it can avoid increase the use of ram. After set this improvements, are generating more than the usual reports, guess I'am in the right way to get this done.
  12. I've find out that this options inside the fast report component, but without luck to get this working as I want to be. EngineOptions.MaxMemSize; EngineOptions.UseFileCache := true; PreviewOptions.PagesInCache := true; I need use this settup configuration, having in mind that I want do reduces the use of RAM memory... Have more ideas to reduces the use of it? please let me know...
  13. I need to set a focus inside a Tedit, simple like this. But the problem is, the component is inside a TRibbonPage, which is only showed if a clicked on. The only event that have is the RibbonTabChange (in TRibbon). I've done like this, but all the others attempts have gonne wrong.... CODIGO needs to be focused, how can I do that??
  14. begin If Handle <> 0 then begin SendMessage (Handlee, WM_SETFOCUS, 0, 0); end; SendMessage(ax, WM_SETFOCUS, 0, 0); end; The final code is like this Peter, I've looking more deep then the ocean to find a solution and where was my mistake. Lukely I've founded. The thing is that I has to defined the variables as global, in the beggin of all. Thanks for your attention, you really save me on this one! best regards, Zazhir.
×