ExternalLinks returned wrong DataSource (extended path)

Hi Aspose team,

if you run attached project you will see that workbook.Worksheets.ExternalLinks[i].DataSource returns

C:\_Work\Toronto\Parent\parent.xlsx

If I go to document XML structure "xl\externalLinks\_rels" I see that following:

<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath" Target="/_Work/Toronto/Parent/parent.xlsx" TargetMode="External"/><?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Can this be quickly fixed as this addition of drive is wrong?

Thanks in advance,
Oliver

Hi,


Thanks for the sample project with template file.

Well, when I open your workbook and see the formulas in formula bar for the underlying cells (B1:B4), I can see the additional drive information/path with external file reference, so I think the ExternalLink.DataSource property gives valid data source as displayed in MS Excel. And, you are also right, when we check the XML in the path “xl\externalLinks_rels”, the data source is without drive’s details. I think you may easily get your desired data source from the ExternalLink.DataSource attribute while splitting or removing @ “:” to eliminate the drive (first part) by yourself accordingly.

Thank you.
Hi Amjad,

problem is that Excel is adding this automatically when you check values in cells or do EditLinks. I cannot remove everything after : as there might be cases that I have drive in link which is not automatically added and by removing everything before : I might kill my link.

Now question is why Aspose is adding this what is not part of the XML document? Can we have additional property (with setter also) called Target which will show value from Target node?

Also did you notice that when you do mouse-over cell you see "C:\_Work\Toronto\Parent\parent.xlsx" and Target value is "/_Work/Toronto/Parent/parent.xlsx"so we have \ and / difference also.

Thanks,
Oliver
Hi again,

Please check also attached document child.xlsx.
If you copy it on C drive and open it in Excel you will see ExternalLink

"D:\_Work\Toronto\Parent1\parent.xlsx"

If you run my simple project over this document Aspose is returning:

"C:\_Work\Toronto\Parent1\parent.xlsx"

Over https://support.microsoft.com/en-us/kb/328440 correct is path which was used when link was created which is in my case D drive and not C like reported by Aspose.Cells.

BR,
Oliver

Hi,


Thanks for providing us further details.

As we already observed the possible issue as you mentioned by using the following sample code with your template file. I found the ExternalLink returned wrong DataSource with extended path as you pointed out. Also, if I open the the document XML structure file: “xl\externalLinks_rels” I can see the Target attributes as:
“/_Work/Toronto/Parent/parent.xlsx”.
We need to check if we could return similar string for ExternalLink.DataSource property?
e.g
Sample code:

Workbook workbook = new Workbook(@“E:\test2\externallinks\PDF\bin\Debug\child.xlsx”);
for (int i = 0; i < workbook.Worksheets.ExternalLinks.Count; i++)
{

Console.WriteLine(“Data Source:” + workbook.Worksheets.ExternalLinks[i].DataSource); //C:_Work\Toronto\Parent\parent.xlsx
Console.WriteLine(“ToString:” + workbook.Worksheets.ExternalLinks[i].ToString());

}

I have logged a ticket with an id “CELLSNET-44402” for your issue. Our concerned developer from product team will evaluate your issue if we could fix it out as per your demand.

Once we have an update on it, we will let you know here.

Thank you.

Hi,


Our product team has evaluated your issue in details. Currently, the value is same as displayed in MS Excel. We will add a new property to return stored data in the file for your requirements.

Once we implement this feature, we will let you know here.

Keep in touch.

Thank you.
Hi Amjad,

thanks for this update. Do you have estimate when this will be provided? This will be get/set property, right? I'll need to make changes of this value :)

Btw. I think that problem is because Aspose.Cells does not work like Excel. If you check my previous comment you can see that in Excel you have D drive and when you access this value over Aspose.Cells C drive is returned.

Thanks,
Oliver

Hi Oliver,


Thanks for pointing it out.

I have logged your concerns against your issue “CELLSNET-44402” into our database. I have also asked the concerned developer from product team to consider your requirements (get/set external data source) fully (if possible). Furthermore, I have requested him to provide an ETA on the ticket.

Once we have an update on it, we will let you know here.

Thank you.

Hi,


It is to update you that the ticket logged earlier as CELLSNET-44402 has been marked resolved. We will soon share the fixed version here after ensuring the quality and incorporating other enhancements and fixes.

Once the fix is available, we will share it here with details.

Thank you.
Great news, thanks.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET (Latest Version) and let us know your feedback.

Hi,

thanks for this. I just checked and OriginalDataSource returns data but I have 2 issues:

1. I get following returned:

Data Source:\_Work\Toronto\Parent1\parent.xlsx

and in document XML structure I have Target="/_Work/Toronto/Parent1/parent.xlsx". You can see that I have \ where / is written in the document.

2. Bigger issue is that setter is missing :-(. I need to read and change OriginalDataSource same way like it is possible for DataSource.

Can this be fixed?

Thanks in advance,
Oliver

Hi,


Thanks for providing us details.

1) You are right, it returns: “_Work\Toronto\Parent\parent.xlsx” but in the document XML structure file: “xl\externalLinks_rels” we can see the Target attribute as:
“/_Work/Toronto/Parent/parent.xlsx”. I have reopened the issue. We will check if we could match with the XML structure as per your demand.

2) Well, you may try to set it by using ExternalLink.DataSource attribute. Let us know if you find any issue.

Thank you.
Hi again,

as DataSource also formats external link like new OriginalDataSource please either:

- change that both properties are returning same /
or
- leave as it is and then we can programmatically use what we need

If you correct only OriginalDataSource without adjusting DataSource will be difficult to figure what is really correct. Maybe better option is to leave it like it is in this version without any additional change.


Thanks,
Oliver

Hi,


Thanks for sharing further details.

Your concerns make sense. I have logged your suggestion(s) against your issue “CELLSNET-44402” into our database. Our concerned developer from product team will evaluate and look into it accordingly.

Once we have an update on it, we will let you know here.

Thank you.

The issues you have found earlier (filed as CELLSNET-44402) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi again,

I believe that bug CELLSNET-44402 is regression with Aspose.Cells 18.3.
In original file I have following external links:

Data Source: https:\\aspose.sharepoint.com\Fund I\LPs\LP Call Downs\Master Call Down Fund I.xlsx
Original Data Source:https://aspose.sharepoint.com/Fund I/LPs/LP Call Downs/Master Call Down Fund I.xlsx

After I just save this file to new file name (no changes done) my original data source is changed to https:\\aspose.sharepoint.com\Fund I\LPs\LP Call Downs\Master Call Down Fund I.xlsx

Again / is replaced with . Can you please check?
Sample project is attached.

Thanks,
Oliver

ExternalLinks-BackSlash-Slash.zip (649.7 KB)

@dr_oli

Please see the reply in your other topic. Here is the link to the post for your reference.