Pivot Tablonun Dış Bağlantı Veri Kaynağını Alın
Contents
[
Hide
]
Pivot Tablonun Dış Bağlantı Veri Kaynağını Alın
Aspose.Cells, pivot tablonun harici bağlantı veri kaynağını alma olanağı sağlar. Bunun için API,Harici Bağlantı Veri KaynağımülkiyetiPivot tablo sınıf. buHarici Bağlantı Veri Kaynağıözellik döndürürHarici Bağlantı nesne. Aşağıdaki kod parçacığı,PivotTable.ExternalConnectionDataSource pivot tablonun harici bağlantı veri kaynağını alma özelliği.
Basit kod
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-.NET | |
// Source directory | |
string sourceDir = RunExamples.Get_SourceDirectory(); | |
// Load sample file | |
Workbook workbook = new Workbook(sourceDir + "SamplePivotTableExternalConnection.xlsx"); | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Get the pivot table | |
var pivotTable = worksheet.PivotTables[0]; | |
// Print External Connection Details | |
Console.WriteLine("External Connection Data Source"); | |
ExternalConnection[] connections = pivotTable.GetSourceDataConnections(); | |
foreach(ExternalConnection conn in connections) | |
{ | |
Console.WriteLine("Name: " + conn.Name); | |
Console.WriteLine("Type: " + conn.SourceType); | |
} |
Kod parçacığında kullanılan kaynak dosya referans olarak eklenmiştir.