ピボットテーブルの外部接続データソースの取得
Contents
[
Hide
]
ピボットテーブルの外部接続データソースの取得
Aspose.Cellsは、ピボットテーブルの外部接続データソースを取得する機能を提供します。そのために、APIはPivotTableクラスのExternalConnectionDataSourceプロパティを提供します。ExternalConnectionDataSourceプロパティはExternalConnectionオブジェクトを返します。次のコードスニペットは、ピボットテーブルの外部接続データソースを取得するためにPivotTable.ExternalConnectionDataSourceプロパティの使用を示しています。
サンプルコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// Source directory | |
String sourceDir = Utils.Get_SourceDirectory(); | |
// Load sample file | |
Workbook workbook = new Workbook(sourceDir + "SamplePivotTableExternalConnection.xlsx"); | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Get the pivot table | |
PivotTable pivotTable = worksheet.getPivotTables().get(0); | |
// Print External Connection Details | |
System.out.println("External Connection Data Source"); | |
System.out.println("Name: " + pivotTable.getExternalConnectionDataSource().getName()); | |
System.out.println("Type: " + pivotTable.getExternalConnectionDataSource().getType()); |
コードスニペットで使用されるソースファイルは、参照用に添付されています。