How to use TFDJSONDataSets in Delphi XE4?

4

Explanation

Today I was seeing an example called FireDACJSONReflect in the Samples folder of Delphi XE6 and I saw that it was very interesting how the server communicated with the client and I would like to use this medium in my application using TFDMemTable to popular the data of my DBGrid , and also saw that it was the only "direct" way to communicate with my TIWDBGrid (IntraWeb components (IW) DBGrid component).

** My application is a server made in and a client made **

Problem

However, my application does not use delphi xe4, so I do not know how to make this communication because delphi xe4 does not have Data.FireDACJSONReflect to add in uses so I do not have the object TFDJSONDataSets and there is my problem ...

  • How to use TFDJSONDataSets in Delphi XE4?
  • How popular is TFDMemTable data without using TFDJSONDataSets ?

Some code

Here I have some lines of code that used in a delphi xe6 datasnap server would work but mine is in xe4:

function TDSSMetodoFinanceiro.getCotacaoLista : TFDJSONDataSets;
var 
  FDQCotacaoLista : TADQuery;
begin
  Result := TFDJSONDataSets.create;
  TFDJSONDataSetsWriter.listAdd(result, FDQCotacaoLista);
end;

And the question comes, why do I want my function to return a TFDJSONDataSet ?

This is because I have a TFDMemTable in my client application in delphi xe6 and I need to populate it with data using .appendData and this apparently needs a TFDJSONDataSet to do this ( maybe there is another way and I would very much like to know if it exists, but so far I only know this one.)

    
asked by anonymous 19.09.2014 / 16:03

1 answer

4

TFDJSONDatasets was introduced in XE6, unfortunately there is no way to use it in XE4. perhaps the path is an FDMemtable instead.

There's a tutorial for XE5 that might serve pro XE4 .

Here's a example using ClientDataset , try and see if it works.

    
29.09.2014 / 15:29