files.zip (16.9 KB)
Aspose,
We are using Aspose Cells 17.9.0.0 and having an issue with an Excel connection created by the “Get & Transform” feature. The Aspose DLL reports the connection but it does not have a SourceFile. To reproduce the issue, follow these steps:
- Create a new XLSX file.
- Enter the value “1” in cell A1.
- Save the file as “child.xlsx”.
- Create another new XLSX file.
- Use the “Get & Transform” feature to import the file (Data -> New Query -> From File -> From Workbook).
- Navigate to and select the “child.xlsx” file.
- Select “Sheet1” and click the “Load” button.
- Save the file as “parent.xlsx”.
- When the “parent.xlsx” file is loaded by the Aspose DLL, the connection does not have a SourceFile property set.
@LinkTekSupport
Thanks for using Aspose.Cells.
We were able to observe this issue as per your description and as shown in the following screenshot. It seems this feature is not supported. We will look into it and implement or fix it if possible. Once, we will have some news for you, we will let you know asap.
This issue has been logged as
- CELLSNET-45962 - Use the “Get & Transform” feature to import the file (Data → New Query → From File → From Workbook) - SourceFile is lost
Download Link:
sc.png (223.4 KB)
C#
Workbook wb = new Workbook("parent.xlsx");
Aspose.Cells.ExternalConnections.ExternalConnection con = wb.DataConnections[0];
Screenshot
The specification of the file format is here: https://msdn.microsoft.com/en-us/library/mt577220(v=office.12).aspx
Is there a way that you can expose to us the unparsed (base64) string for us to read/parse and write?
@tjenkins
We have logged your provided information in our database for further investigation. We will check if we could implement it. In case we could not resolve this issue, we will close it as Won’t Fix.
@tjenkins
Please try the following code to get the unparsed (base64) string.
C#
string DataMashup = "";
Workbook workbook = new Workbook("parent.xlsx");
var parts = workbook.CustomXmlParts;
for (int i = 0; i < parts.Count; i++)
{
var part = parts[i];
byte[] data = part.Data;
var rdr = new System.Xml.XmlTextReader(new MemoryStream(data));
rdr.MoveToContent();
if (rdr.LocalName == "DataMashup")
{
DataMashup = rdr.ReadElementString();
break;
}
}//for