简体   繁体   English

如何使用Aspose Cells将数据透视表放在不同的工作表上?

[英]How is it possible to put a PivotTable on a different sheet using Aspose Cells?

I see here how to create a PivotTable on the same sheet as the source data, like so: 在这里看到如何在与源数据相同的表上创建数据透视表,如下所示:

int index = pivotTables.Add("=A1:C8", "E3", "PivotTable2");

The first arg ("=A1:C8") is the source data to extract, the second ("E3") is the cell that will serve as the NW corner of the PivotTable - on the same sheet. 第一个arg ("=A1:C8")是要提取的源数据,第二个("E3")是将用作数据透视表的NW角的单元格-在同一张纸上。

I need to put my PivotTable on a separate sheet (and then hide the source data tab altogether). 我需要将数据透视表放在单独的工作表上(然后完全隐藏“源数据”选项卡)。

How can I specify that the second argument is on another sheet? 如何指定第二个参数在另一个工作表上?

Suppose, your data is inside the worksheet named "MyDataSheet" and your cell range is A1:D25, then your source data will be MyDataSheet!A1:D25 , now select any of your worksheet and add the pivot table like this. 假设您的数据位于名为“ MyDataSheet”的工作表中,并且单元格范围为A1:D25,那么您的源数据将为MyDataSheet!A1:D25 ,现在选择您的任何工作表并添加数据透视表。

anySheet.PivotTables.Add("MyDataSheet!A1:D25", "E3", "MyPivot");

It will now add pivot table inside the anySheet but the data will come from MyDataSheet . 现在它将在anySheet内添加数据透视表,但数据将来自MyDataSheet

Note: I am working as Developer Evangelist at Aspose 注意: 我在Aspose担任开发人员布道者

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

相关问题 是否可以解锁受保护工作表中的特定单元格(使用Aspose) - Is it possible to unlock specific cells in a protected sheet (Using Aspose) 如何确定数据透视表生成多少行(Aspose Cells)? - How can I determine how many rows a PivotTable generates (Aspose Cells)? 如何提供基于Aspose.Cells数据透视表中其他两个值的计算值? - How can I provide a calculated value that is based on two other values in an Aspose.Cells PivotTable? 为什么尝试对数据透视表中的颜色范围无效(Aspose Cells)? - Why does attempt to color ranges in a PivotTable have no effect (Aspose Cells)? 如何使用ASPOSE.Cells实例化Office 365 excel文件? - How to instantiate office 365 excel file using ASPOSE.Cells? 如何使用Aspose从数据库填充Excel工作表 - how to fill excel sheet from database using Aspose 在数据透视表中搜索值并复制到不同的工作表中 - Search for Values in PivotTable and Copy into Different Sheet Aspose:使用 aspose jar 将自定义属性设置为工作表 - Aspose : set custom properties to a sheet using aspose jar 如何用不同的值代替自动生成的总计值(Aspose Cells)? - How can I replace automatically-generated grand total values with different ones (Aspose Cells)? 如何在Excel中将2个单元格与另一个工作表中的另外2个单元格进行比较? - How to compare 2 cells to another 2 cells in a different sheet in excel?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM