简体   繁体   English

Excel Task Pane App中矩阵绑定的最大数据大小是多少?

[英]What is the maximum data size for matrix bindings in an Excel Task Pane App?

I created an excel task pane app with microsofts JavaScript API. 我使用Microsoft的JavaScript API创建了一个excel任务窗格应用。 I created an binding to the excel sheet that contains some data. 我创建了到包含一些数据的excel工作表的绑定。

Something like: 就像是:

Column1 | Column2
Value1  | Value2
Value1  | Value1
Value2  | Value3

My App created a chart for each column (with dc.js ). 我的应用程序为每个列创建了一个图表(使用dc.js )。 Then the User can filter with the charts so that the app can write the filtered data into the binding. 然后,用户可以使用图表进行过滤,以便应用程序可以将过滤后的数据写入绑定中。

Everything works fine with a small binding range. 绑定范围较小,一切正常。 When i increase the binding range to approximately 1500 rows and 3 columns, he won't update the binding data . 当我将绑定范围增加到大约1500行和3列时, 他不会更新绑定数据 Excel don't show me some errors, it just do nothing. Excel不会向我显示一些错误,它什么也不做。

This is a simplified version of my code: 这是我的代码的简化版本:

createBinding({ id, callback = ()=>{}, type = 'matrix' }) {
    Office.context.document.bindings.addFromSelectionAsync(type, {id}, callback);
}

// options = { coercionType: "matrix" }
setBindingData({ id, data, options, callback }) {
    Office.select(`bindings#${id}`).setDataAsync(data, options, callback);
}

I think the problem is the max size of all data. 我认为问题是所有数据的最大大小。 But i would like to know what the maximum size is? 但是我想知道最大尺寸是多少? I couldn't find something on stackoverflow or in the Microsoft documentation. 我在stackoverflow或Microsoft文档中找不到任何内容。

It could be because O365 does not allow any single operation to hang the app for more than 5 seconds. 可能是因为O365不允许任何一项操作将应用程序挂起超过5秒钟。 Try using async calls. 尝试使用异步调用。

I was interested in this question too and so ran some tests and there seems to be a huge difference between empty cells and data. 我对这个问题也很感兴趣,因此进行了一些测试,并且空单元格和数据之间似乎存在巨大差异。 I could bind and read data from nearly 4 million blank cells. 我可以绑定和读取近400万个空白单元格中的数据。 But when I added some simple data this came down to around 90,000 cells. 但是,当我添加一些简单的数据时,这大约减少到90,000个单元格。 The shape of the binding didn't seem to matter too much, be it tall or wide. 装订的形状似乎并不重要,无论是高还是宽。 So I suspect your cells might have a lot more data in them than my test data. 因此,我怀疑您的单元格中可能包含比我的测试数据更多的数据。

You might be able to work something out using the documentselectionchanged handler instead. 您可能可以改为使用documentselectionchanged处理程序来解决问题。 Eg loop through the rows and as it changes get the data. 例如,循环遍历各行,并随着其更改获取数据。

See http://microsoft-office-add-ins.com for more information. 有关更多信息,请参见http://microsoft-office-add-ins.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM