Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FDMemTable->AppendData how to retrieve the progression of the appending


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Gaetano Mantovani

Posts: 19
Registered: 8/30/14
FDMemTable->AppendData how to retrieve the progression of the appending  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 3, 2017 5:52 AM
Dear All,
I'm following this tutorial http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Tutorial:_Using_a_REST_DataSnap_Server_with_an_Application_and_FireDAC and all work.
I changed the data that the server methods retrieve and I read the data from an existing MySQL database, it works but when I append the data in the client's memtable if the records are many (8000~) the appenData function takes some time.
I'm wondering if there is a way to 'intercept' the adding in the memtable and know how many records the function is adding (the purpose is to show a progressbar):

here my code in the client part:

void TClientForm::GetZones(const System::String ANATIONID)
{
+ TJSONObject* LJSONObject+
+ (ClientModule1->ServerMethods1Client->GetZones(ANATIONID));+

+ std::auto_ptr<TFDJSONDataSets>LDataSets(new TFDJSONDataSets());+

+ TFDJSONInterceptor::JSONObjectToDataSets(LJSONObject, LDataSets.get());+

+ { // multiple declaration for 'LDataSet'+
+ TFDAdaptedDataSet * LDataSet = TFDJSONDataSetsReader::GetListValueByName+
+ (LDataSets.get(), sZones);+
+ // Update UI+
+ FDMemTableZones->Active = false;+
+ FDMemTableZones->AppendData(*LDataSet);+
+ }+

+ { // multiple declaration for 'LDataSet'+
+ TFDAdaptedDataSet * LDataSet = TFDJSONDataSetsReader::GetListValueByName+
+ (LDataSets.get(), sTowns);+
+ int Recs = LDataSet->RecordCount;//Here I know that there are a Nr of records to append+
+ // Update UI+
+ FDMemTableTowns->Active = false;+
+ FDMemTableTowns->AppendData(*LDataSet);//how to show the progressbar during the appending???+
+ }+
}

Thanks
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02