Good afternoon. Firstly, I am not a native speaker of English, I may have some grammatical errors or such.
I need advice from people who have done something or the application in the same way as mine, well, the thing is that I use TProgressBar in my delphi form, another component called "TExcelApplication" and TDBGrid.
When I export the contents of the DBGrid, the application freezes, so I basically set a ProgressBar for this to find out how far the process was completed. I realized that when TDBGrid extracts and exports each row to a new Excel workbook, you cannot move the actual form, so you need to wait until the process is complete to move this form.
So, is there anything you can do (I was thinking about threads, but I'm not sure if they can help) so that the user can move the window if he wants to?
Thank you so much for taking your time reading and giving me advice. I am using Delphi XE.
Here is the code that I use to export strings:
with ZQDetalles do begin First; while not EOF do begin i := i + 1; workSheet.Cells.Item[i,2] := DBGridDetalles.Fields[0].AsString; workSheet.Cells.Item[i,3] := DBGridDetalles.Fields[1].AsString; workSheet.Cells.Item[i,4] := DBGridDetalles.Fields[2].AsString; workSheet.Cells.Item[i,5] := DBGridDetalles.Fields[3].AsString; workSheet.Cells.Item[i,6] := DBGridDetalles.Fields[4].AsString; workSheet.Cells.Item[i,7] := DBGridDetalles.Fields[5].AsString; workSheet.Cells.Item[i,8] := DBGridDetalles.Fields[6].AsString; workSheet.Cells.Item[i,9] := DBGridDetalles.Fields[7].AsString; Next; barraProgreso.StepIt; end; end;
If you want to see all the code for the Export button, feel free to see this link: http://pastebin.com/FFWAPdey