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
https://issues.apache.org/bugzilla/show_bug.cgi?id=52903

             Bug #: 52903
           Summary: XSSF & HSSF shiftrows does not shift hyperlink
                    references
           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();
        sh.createRow(0);

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

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

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

-- 
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


Mime
View raw message