This is something I put in mine for a mail link (hope it helps):
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);
hlink_style.setLocked(false) ;
Hyperlink link = null;
cell = sheet.createRow(2).createCell((short)0);
cell.setCellValue("E-Mail For Help");
link = factory.createHyperlink(Hyperlink.LINK_EMAIL);
link.setAddress("mailto:[email protected]?subject=General_Help");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
-Lou
"Flynn, Michelle M." <[email protected]> wrote on 09/15/2011 10:51:16
AM:
> I've had success with creating a LARGE SXSSFWorkbook with no memory
> errors ( THANKS guys! ). I've been able to create Sheets, rows and
> cells. Now I've come to a cell I don't know how to create. I need to put
> a hyper link into a cell with a file name in it, it will actually be a
> jpg file or some other type of image file. When the link is selected in
> the outputted excel file I'd like the default image program to display
> the file.
>
> I'm using an SXSSFWorkbook to resolve a memory issue with very large
> output.
>
> Here are the types of sheet, row and cell I've been using
>
> import org.apache.poi.ss.usermodel.Row;
>
> import org.apache.poi.ss.usermodel.Sheet;
>
> import org.apache.poi.ss.usermodel.Cell;
>
> import org.apache.poi.ss.usermodel.CellStyle;
>
> import org.apache.poi.ss.usermodel.CreationHelper;
>
>
>
> I see that under createHelper there is a createHyperlink( int type ),
> but how do I use that and is that the correct thing to be using?
>
> createHelper = outputWorkbook.getCreationHelper();
>
>
>
> I only have a few days left at this company and would like to be able to
> wrap this up or at least be able to tell someone how to do this. Any
> help would be greatly appreciated!
>
>
>
> Thanks
>
> Michelle
>
>
>
>
>