https://bz.apache.org/bugzilla/show_bug.cgi?id=69265

--- Comment #2 from nikknp.du...@gmail.com ---
Code to reproduce - 
public class Driver {
    public static void main(String[] args) {

        // Create a new workbook and sheet
        HSSFWorkbook workbook = new HSSFWorkbook();
        HSSFSheet sheet = workbook.createSheet("Hyperlink Example");

        // Create a row and a cell
        HSSFRow row = sheet.createRow(0);
        HSSFCell cell = row.createCell(0);

        // Create a hyperlink
        CreationHelper createHelper = workbook.getCreationHelper();
        Hyperlink hyperlink =
createHelper.createHyperlink(HyperlinkType.EMAIL);
        hyperlink.setLabel("mylabel");
        hyperlink.setAddress("http://www.example.com";);

        // Set the label and the hyperlink
        cell.setCellValue("Click here");
        cell.setHyperlink(hyperlink);


        // Get the cell value and hyperlink address
        String cellValue = cell.getStringCellValue();
        Hyperlink cellHyperlink = cell.getHyperlink();
        String hyperlinkAddress = cellHyperlink.getAddress();
        HyperlinkType hyperlinkType = cellHyperlink.getType();

        System.out.println("Cell Value: " + cellValue);
        System.out.println("Hyperlink Address: " + hyperlinkAddress);
        System.out.println("Hyperlink type: " + hyperlinkType.toString()); //
even though I gave type as Email in line 35, hyperlink type shows as URL here
        System.out.println("Hyperlink label: " + cellHyperlink.getLabel());

    }
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to