tags:

views:

86

answers:

2

Hi,

Is there is any way to write hyperlink in Excel cell using java.

e.g. I want to write two hyperlink in one cell.

When i click on google.com it should open google site and same for yahoo site.

www.google.com | www.yahoo.com

Thanks

A: 

If you are using Apache POI, you can use the setFormula [1] method of HSSFCell to write a formula HYPERLINK("http://example.com")

[1] http://poi.apache.org/spreadsheet/formula.html

retronym
with this option able to write only one hyperlink in one cell.
Yashwant Chavan
Correct. POI supports a HSSFRichTextString, but this doesn't allow Hyperlinks. I can't see how to even do this in Excel itself, perhaps you need a new version. You can save as XML Workbook from Excel, and then write code to generate this XML format.
retronym
A: 

It is impossible to have more than one hyperlink per XLS cell. However, that link gives a "cheat" which involves using multiple linked shapes (which I doubt POI supports).

Matthew Flaschen