GridExcelIO application not responding

Hello

I use gridexcelio component in order to import excel XLS files into a FNC Grid, after loaded I save row by row into a SQLite DB.

Component works fine with small files, usually less than 2MB, but If I try to "import" a bigger files then my application shows "not responding" and does not dissapear.

Why you did not take care of this when execute the "import" process in order to load big data files to a FNCGrid?

Video below shows the issue

https://timbralofacil.com/descargas/gridexcel.mp4

I am using Delphi 11.3 with latest TMS components, this happens on Android

Did you use BeginUpdate / EndUpdate around your code which is required to speed up the process of importing data? Without a code snippet it's difficult to understand what happens

The only code that hangs my app is the next line:

TTMSFNCGRIDEXCELIO.XLSImport(FILENAME);

I don't see why use BeginUpdate or EndUpdate in there isn't?

Use

TMSFNCGrid1.BeginUpdate;
try
  TMSFNCGridExcelIO.XLSImport();
finally
  TMSFNCGrid1.EndUpdate;
end;

I coded your suggestion, but remains the issue

Can you give us insight on how many rows / columns the XLS file contains?

Ferreteria1.xls (2.7 MB)

Above is part of the file but remains the troubles on Android, the original file is about 30,000 rows and you can download it from the next link:

https://timbralofacil.com/descargas/ferreteria.xls

Pieter concerning to this point, I did not know any about the TMSFNCGridExcelIO.XLSImport process but I think a possible solution is:

  1. Get the number of rows inside the XLS file prior to start importing in the TMSFNCGrid
  2. Start importing process in chunks of 500 rows, after a chunk is reached maybe you can put an "application.processmessages"

Do you think this could work?

@adrian Does the excel bridge have better performance for larger XLS files or does it purely rely on the grid?

The idea to use the grid is just a middle tier between the excel file and the SQLite DB, but I don't need to show the grid to the enduser.

If you have another way to read row by row the excel file then point me in the right direction please.

Also I used "export" method too in order to allow my end user to share an XLS file with some results, if the "export" FNC method takes too much in create the result the application hangs.

What I am trying to tell you is that I need a way to read/write bigger XLS files with FNC no matter if I don't use any grid, finally my enduser want results. Read XLS it's for import to a SQLite DB, and WRITE XLS is to export results from the SQLite DB and share across any electronic media like: whatsapp, facebook messenger, bluetooth or just simply to save to a usb.

The application not responding it's only on Android, I tested on Windows and iOS without any problem.