poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52903] New: XSSF & HSSF shiftrows does not shift hyperlink references
Date Tue, 13 Mar 2012 17:05:22 GMT

             Bug #: 52903
           Summary: XSSF & HSSF shiftrows does not shift hyperlink
           Product: POI
           Version: 3.8-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: cross22@llnl.gov
    Classification: Unclassified

Created attachment 28462
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28462
Example output file

When shifting rows in an HSSF or XSSF worksheet, any hyperlink references are
not shifted along with rows. In the example, if shift rows is commented out,
the code works as expected placing a cell at 0,0 containing the word Google and
a link to Google.  However, if shift-rows is applied, the output file contains
the word Google in row 1 and the link in row 0 (see attached output file).

        //create a workbook and add a sheet and row
        XSSFWorkbook wb=new XSSFWorkbook();
        CreationHelper createHelper = wb.getCreationHelper();
        Sheet sh=wb.createSheet();

        //create a cell and add a hyperlink
        Cell c=sh.getRow(0).createCell(0);
        Hyperlink link = createHelper.createHyperlink(Hyperlink.LINK_URL);
        link.setAddress(new URL("http://www.google.com").toString());

        //shift row by 1
        sh.shiftRows(0, 0, 1);

        //write workbook
        FileOutputStream fos=new FileOutputStream("shiftrowsexample.xlsx");

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message