我能够使用 REST API 查询在 excel Web 应用程序中填充数据的方法/最佳实践是什么?
我想创建一个模板并将其上传到我的网站,该模板将通过查询基于 REST 或 SOAP 的服务来刷新显示的数据。
How about a normal jquery based webapp using wcf service to populate your excel. So simply put initiates an ajax call to your REST endpoint?
try{
$.ajax({
type: 'POST',
url: '/REST-URL',
contentType: 'xml',
data: '{data : your data does in here}',
success: function (msg) {
Office.context.document.setSelectedDataAsync(msg);
},
error: function () {
result = "fail";
}
});
} catch (err) {
result = err.description;
}
Best practices should be based on how complicated your app is.