External Links Datasource

Hi there, I've just pulled down an eval copy of Aspose.Total for .Net version 1.4.0.6 primarily to test the .Cells and .Tasks functionality.

My first fragment of code interrogates an Excel spreadsheet to report any external links, this works fine but the first character of the ExternalLink name is always missing.

Here's the code fragment:

Console.WriteLine("Process start, opening workbook");

Workbook workbook = new Workbook();

workbook.Open(@"C:\Temp\TestOne.XLS");

int worksheets = workbook.Worksheets.Count;

Console.WriteLine("Workbook open {0} worksheets", worksheets);

int LinkCount=workbook.Worksheets.ExternalLinks.Count;

Console.WriteLine("{0} external links",LinkCount);

// Have to use for loop since ExternalLinks has no public enumerator.

for(int linkIndex=0;linkIndex<LinkCount;linkIndex++)

{

Console.WriteLine(workbook.Worksheets.ExternalLinks[linkIndex].DataSource.ToString());

}

The workbook TestOne.Xls has several external links to TestTwo.Xls & TestThree.Xls.

But these are reported as estTwo.Xls & estThree.Xls.

Hi,

Thanks for reporting,

Yes, we found the problem (first character of the name of external link file is missing). We will figure it out soon.

Thank you.

Hi,

Please try this fix.

In this fix,we use Cell.GetStyle and SetStyle method replace the property of Cell.Style. The two methods will save more memory usage than cell.Style property.

If you want to set style of the cell, please change your codes as :

//Getting the style of the cell.

Style style = cell.GetStyle();

//Setting the property of the style.

.......

//Setting the style of the cell

cell.SetStyle(style);