[英]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.