I'm working with a developer on a project to add an Excel export function to
a website.

For one of the cells that we're exporting, we want to turn the destination
cell into a hyperlink that, on click, will send a User to a web site.

e.g. Website...export values to multi-sheet excel file....on one sheet, well
have a label that says..."click here for supplemental information"  The cell
containing the "click here..." needs to be an active hyperlink that will
take them to a website.  In addition, the cell itself needs to provide a
visual cue that it is indeed a hyperlink (s/b blue and underlined)

We're using POI and making use of the following types of commands found in
the documentation:

Hyperlink link = createHelper.createHyperlink(Hyperlink.LINK_URL);
link.setAddress("http://poi.apache.org/";);
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
 
//cell style for hyperlinks
//by default hypelrinks are blue and underlined
CellStyle hlink_style = wb.createCellStyle();
Font hlink_font = wb.createFont();
hlink_font.setUnderline(Font.U_SINGLE);
hlink_font.setColor(IndexedColors.BLUE.getIndex());
hlink_style.setFont(hlink_font);

To date, our results have been that we're getting a cell in the worksheet
that is functioning as a hyperlink but we can't seem to get the hyperlink
styling (blue underline) to manifest itself.

In addition, I've tried setting a cell above the destination cell to be
"=hyperlink(destcellreference)" -- and that only works if I then go to the
cell and do F2-Enter.

Can someone provide us some assistance / pointers on how we might be able to
get our link styling to work ?

(p.s. we've been exporting to Excel2003 but for grins I just tried 2007 and
the results were the same)

Thanks
-- 
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Excel-Hyperlink-Styling-with-POI-tp3299157p3299157.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to