We have the following test file: PowerQueryTestConnections.xlsx.zip (20.1 KB)
This file contains 8 queries. In Excel, they are listed as follows in the ‘Queries & Connections’ pane:
PowerQueryFormulas list.png (10.5 KB)
In our application, we try to read the same display info as in Excel. Currently, the order of queries returned by Aspose is not the same as in Excel. Also, it is not possible to read the group of a query.
Here is some test code to demonstrate what we try to achieve:
var workbook = new Workbook("PowerQueryTestConnections.xlsx");
var powerQueryFormula = workbook.DataMashup.PowerQueryFormulas[0];
Console.WriteLine(powerQueryFormula.Name); // expected: start_time
Console.WriteLine(powerQueryFormula.Group); // not possible, expected: Fills / test
powerQueryFormula = workbook.DataMashup.PowerQueryFormulas[1];
Console.WriteLine(powerQueryFormula.Name); // expected: end_time
Console.WriteLine(powerQueryFormula.Group); // not possible, expected: Fills / test
powerQueryFormula = workbook.DataMashup.PowerQueryFormulas[2];
Console.WriteLine(powerQueryFormula.Name); // expected: limit
Console.WriteLine(powerQueryFormula.Group); // not possible, expected: Fills / test
powerQueryFormula = workbook.DataMashup.PowerQueryFormulas[3];
Console.WriteLine(powerQueryFormula.Name); // expected: FIlls
Console.WriteLine(powerQueryFormula.Group); // not possible, expected: Fills / test
powerQueryFormula = workbook.DataMashup.PowerQueryFormulas[4];
Console.WriteLine(powerQueryFormula.Name); // expected: fill_url
Console.WriteLine(powerQueryFormula.Group); // not possible, expected: Fills / test
powerQueryFormula = workbook.DataMashup.PowerQueryFormulas[5];
Console.WriteLine(powerQueryFormula.Name); // expected: Table 0
Console.WriteLine(powerQueryFormula.Group); // not possible, expected: Other Queries
powerQueryFormula = workbook.DataMashup.PowerQueryFormulas[6];
Console.WriteLine(powerQueryFormula.Name); // expected: from_timestamp
Console.WriteLine(powerQueryFormula.Group); // not possible, expected: Other Queries
powerQueryFormula = workbook.DataMashup.PowerQueryFormulas[7];
Console.WriteLine(powerQueryFormula.Name); // expected: Invoked Function
Console.WriteLine(powerQueryFormula.Group); // not possible, expected: Other Queries
Can you update the PowerQueryFormulas collection to (1) return the queries in the same order as in Excel, and (2) add a property (or some structure) to relate the group of a query?
We’re using Aspose.Cells 24.11.0 for .NET. Thank you!