如何使用Open XML刷新Excel 2010的数据透视缓存 [英] How to refresh Pivot Cache of Excel 2010 using Open XML
问题描述
我正在使用 Open XML 制作 Excel工具以进行某些数据处理.为此,在插入数据后,我需要通过刷新数据透视缓存,以编程方式刷新数据透视表.我可以通过 Microsoft.Office.Interop.Excel程序集完成此操作,但是打开大文件需要花费一些时间,因此我想使用Open XML进行此操作.
I am making an Excel Tool using Open XML for some data processing. In this I need to refresh my pivot tables programmatically after inserting the data by refreshing the pivot Cache. I can do this by Microsoft.Office.Interop.Excel assembly but it takes time in opening large files so I want to do this by using Open XML.
您是否知道如何使用Open XML做到这一点?
Do you have any idea that How can I do this using Open XML?
请尽快回复.
谢谢
推荐答案
参见此处的答案: Excel全部刷新"使用OpenXML
直接编辑ooxml以填充模板xlsx时:
编辑ivotcache xml文件: xl/pivotCache/pivotCacheDefinition * .xml
添加属性值: refreshOnLoad ="1"
到节点: pivotCacheDefinition
when directly editing ooxml to fill a template xlsx:
edit pivotcache xml file: xl/pivotCache/pivotCacheDefinition*.xml
add the property-value: refreshOnLoad="1"
to node: pivotCacheDefinition
<pivotCacheDefinition
xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
r:id="rId1"
refreshOnLoad="1">
这篇关于如何使用Open XML刷新Excel 2010的数据透视缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!