This project has moved and is read-only. For the latest updates, please go here.

Hyperlinks in OpenXml Excel?

Dec 6, 2011 at 9:09 PM

This is another suggested feature.  It probably also needs to be more fully thought through. :)

 

My users are wanting hyperlinks in the Excel document that is created.  I can set a string to

<a href='something'>label</a>

and that works great with the Html and Excel Writers, but the file contents != extension prompt is a deal breaker for them.

 

The OpenXml Writer parses data types in the RenderRow method.  If some kind of hyperlink sniffing code was there, it could create

cell.Hyperlink = new XLHyperlink(address, label);

and I think you'd get a real hyperlink in a real XLSX document.

Dec 6, 2011 at 10:04 PM

This is a good idea. Since we are using Mercurial now it's very easy to Clone the repo locally, experiment, and if you get it working to push it back up as a Fork in CodePlex. I would love to work on this but I'm not sure when I can, so any community help would be great!

Dec 6, 2011 at 10:16 PM

The idea is good and is very easy to implement on the Open XML side. What exactly would like to be a link? Is a content in a cell or do you want the header or footer text to have hyperlinks in them? I might have an idea on how to achieve both I'm just wondering what you wanted. Thanks!

Dec 6, 2011 at 10:27 PM

Yes, for me, this is a hyperlink in a content cell.  

My case is a grid of rows in an MVC web application with an Edit hyperlink on each row.  The users want to download the grid data to Excel to filter, sort, print, email to others, etc.  The hyperlinks on each row will give them a link to the live data.

Dec 10, 2011 at 11:57 PM

I'm going to create a Feature Request for this in the Issue Tracker. Hopefully someone is up to tackling it!