I'm looking for example how to add hyperlink to cell. Seems that it is not so easy as adding a text.
I got this peace of code that generates right XML but in excel links do not appear
private SheetData PopulateSheetWithData(SheetData sheetData, IList<Event> events, SpreadsheetDocument document)
{
int errorIndex = 0;
foreach (var @event in events)
{
errorIndex++;
Hyperlinks hyperlinks = new Hyperlinks();
Hyperlink hyperlink = new Hyperlink()
{
Location = "UniqueError_" + errorIndex + "!A1",
Display = @event.LOG_CORR_KEY,
Reference = "A"+(errorIndex+1),
Id = "UniqueError_" + errorIndex
};
hyperlinks.AppendChild(hyperlink);
sheetData.AppendChild(hyperlinks);
}
return sheetData;
}
Am I doing something wrong ? I found this article how to add hyperLink but It looks like it's too ever complicated. Any help with this question?