ピボット テーブルの外部接続データ ソースを取得する
Contents
[
Hide
]
ピボット テーブルの外部接続データ ソースを取得する
Aspose.Cells は、ピボット テーブルの外部接続データ ソースを取得する機能を提供します。このために、API はExternalConnectionDataSourceのプロパティピボットテーブルクラス。のExternalConnectionDataSourceプロパティは外部接続物体。次のコード スニペットは、PivotTable.ExternalConnectionDataSourceプロパティを使用して、ピボット テーブルの外部接続データ ソースを取得します。
サンプルコード
This file contains hidden or 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()); |
コード スニペットで使用されているソース ファイルを参照用に添付します。