繁体   English   中英

如果 pivot 表/范围被添加到数据 Model 中,如何在 ZD7EFA19FBE742230D 中获取 pivot 表的来源?

[英]If pivot table/range is added to Data Model, how to get the the source of pivot table in C#?

例如,如果源是 Excel 表,我使用 pivotTableObj.SourceData 我想使用 C# 代码刷新 Pivot 表。 pivotTableObj.SourceData doesn't work if table/range is not added to Excel Data Model I am using checkbox from Insert>>Pivot Table dialog box - "Add this data to data model" to add Excel table to Data model

if (pivotTable.PivotCache().OLAP == true)
{
    ModelTables modelTable;
    modelTable = MyWorkbook.Model.ModelTables;
    foreach(ModelTable modelTable in modelTables)
    {    
         //my purpose was to refresh the pivot table
         //printing just a name for instance
         System.Windows.Forms.MessageBox.Show(modelTable.Name);
    }
}

暂无
暂无

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

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