问题描述
我正在使用Apps for Excel,需要填充一张表格,其中包含由MVC4网络应用程序输出的行。这是跨域的。我看过只有一个示例应用程序通过REST提取YouTube内容而且它不会转换为我的用例。
I'm working with Apps for Excel and need to populate a sheet with rows being output by an MVC4 web-app. It's cross-domain. I've seen only a single sample app pulling YouTube content via REST and it doesn't translate to my use case.
如何点击提供JSON内容的网络应用程序(多个行和列)并将其插入空白表?
How do I hit a web-app that serves JSON content (multiple rows and columns) and insert that to a blank sheet?
推荐答案
function crossDomanAjaxCall() {
And the thread below may be helpful:
http://social.msdn.microsoft.com/Forums/en-US/2b431c22-0708-4d2c-b235-6253800246c0/issues-with-performing-an-ajax-call-within-an-office365-app-for-excel?forum=appsforoffice
>>如何点击提供JSON内容(多行和多列)并将其插入空白工作表的Web应用程序?<<
我们无法直接将JSON内容写入工作表。您需要将其解析为字符串或数组。我们可以通过两种方式将数据写入工作表。第一种是使用
将数据写入选择值。第二个是使用写数据到绑定对象。
>> How do I hit a web-app that serves JSON content (multiple rows and columns) and insert that to a blank sheet?<<
There is no way we can write the JSON content direct to the worksheet. You need to parse it to the string or array. There is two ways we can write data into the work sheet. The first is usingsetSelectedDataAsync write data to the select value. And the second is using Binding.setDataAsync write data to the binding object.
祝你好运
Fei
这篇关于如何将JSONP拉到工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!