放一个FDStanStorageJSONLink1在界面上,或者 引用uses  FireDAC.Stan.StorageJSON ;单元

image

 否则出现上面错误

FDQuery1.SaveToFile('aaa.json',sfJSON);

image

 XML导出也类似