Birlik Aralığı Oluştur
Contents
[
Hide
]
Birlik Aralığı Oluştur
Aspose.Cells, Union Range’i kullanarak Union Range oluşturma yeteneği sağlar.WorksheetCollection.CreateUnionRangeyöntem. buWorksheetCollection.CreateUnionRangeyöntem, birleşim aralığını oluşturmak için adres ve çalışma sayfasının dizini olmak üzere iki parametreyi kabul eder. buWorksheetCollection.CreateUnionRange yöntem bir döndürürBirlik Aralığı nesne.
Aşağıdaki kod parçacığı, kullanarak bir Birlik Aralığı oluşturmayı gösterir.WorksheetCollection.CreateUnionRangeyöntem. Kod tarafından oluşturulan çıktı dosyası referans için eklenmiştir.
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-.NET | |
// Working directories | |
string SourceDir = RunExamples.Get_SourceDirectory(); | |
string outputDir = RunExamples.Get_OutputDirectory(); | |
Workbook workbook = new Workbook(SourceDir + "SamplePowerQueryFormula.xlsx"); | |
DataMashup mashupData = workbook.DataMashup; | |
foreach (PowerQueryFormula formula in mashupData.PowerQueryFormulas) | |
{ | |
foreach (PowerQueryFormulaItem item in formula.PowerQueryFormulaItems) | |
{ | |
if (item.Name == "Source") | |
{ | |
item.Value = "Excel.Workbook(File.Contents(\"" + SourceDir + "SamplePowerQueryFormulaSource.xlsx" + "\"), null, true)"; | |
} | |
} | |
} | |
// Save the output workbook. | |
workbook.Save(outputDir + "SamplePowerQueryFormula_out.xlsx"); |