Union-Bereich erstellen
Contents
[
Hide
]
Union-Bereich erstellen
Aspose.Cells bietet die Möglichkeit, Union Range mithilfe von zu erstellenWorksheetCollection.CreateUnionRangeMethode. DasWorksheetCollection.CreateUnionRangeDie Methode akzeptiert zwei Parameter, die Adresse zum Erstellen des Vereinigungsbereichs und den Index des Arbeitsblatts. DasWorksheetCollection.CreateUnionRange Methode gibt a zurückUnionRange Objekt.
Das folgende Code-Snippet veranschaulicht das Erstellen eines Union-Bereichs mithilfe vonWorksheetCollection.CreateUnionRangeMethode. Die vom Code generierte Ausgabedatei ist als Referenz beigefügt.
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"); |