DataSource property - bug

There is a bug and difference in behaviour between Xlsx and Xls.

To reproduce:

<ol style=“padding-left: 1.5em; font-family: “Lucida Grande”, Arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);”>

  • Create the folder “C:\Generation” and share it.
  • <ol start=“2” style=“padding-left: 1.5em; font-family: “Lucida Grande”, Arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);”>
  • Map the drive letter “P:” to the folder.
  • <ol start=“3” style=“padding-left: 1.5em; font-family: “Lucida Grande”, Arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);”>
  • Unzip the attached files to the folder.

  • Run the following code variations and see the results:
  • public void ShowExternalLink(string path)
    {
    var doc = new Workbook(path);
    var externalLink = doc.Worksheets.ExternalLinks[0];
    Console.WriteLine("DataSource: " + externalLink.DataSource);
    <span style=“font-family: “Lucida Grande”, Arial, sans-serif; font-size: 13px;”>Console.WriteLine("Original DataSource: " + externalLink.OriginalDataSource);
    }

    a) using c drive with xlsx
    b) using c drive with xls
    c) using p drive with xlsx
    d) using p drive with xls

    The results between XLSX and XLS are not the same and I’d expect DataSource to be relative to the drive, but in the case of p drive and xls it shows c drive instead of p drive.

    Hi,


    Thanks for the template files and details.

    Well, the data sources are differently in both your XLS and XLSX files as I tested by opening your both files into MS Excel and check their data sources. See the screenshot (attached) for your reference. So, Aspose.Cells would give you different results too.

    Thank you.