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 49654] New: unreable content in xls
Date Tue, 27 Jul 2010 12:19:46 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49654

           Summary: unreable content in xls
           Product: POI
           Version: 3.6
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: BryanXTong@gmail.com


The example below comes from the POI website and I make some minor changes. By
running it,we can get the error "unreable content in xls"

public class POIExport{
 public static void main(String[] args) throws IOException{
  Workbook wb = new HSSFWorkbook(); //or new HSSFWorkbook();
     CreationHelper createHelper = wb.getCreationHelper();

     //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);


     Sheet sheet = wb.createSheet("Hyperlinks");
     //number of rows
     for (int i = 0; i < 14000 ; i++){
      Row row = sheet.createRow(i);
      //number of columns 
      for(int j = 0 ; j < 5; j++){
       Cell cell = row.createCell((short)j);
       cell.setCellValue("URL Link");
       Hyperlink link = createHelper.createHyperlink(Hyperlink.LINK_URL);
       link.setAddress("http://poi.apache.org/");
       cell.setHyperlink(link);
       cell.setCellStyle(hlink_style);
      }
     }
     FileOutputStream out = new FileOutputStream("hyperinks.xls");
     wb.write(out);
     out.close();
 }
}

It seems that if the number of columns with Hyperlink is getting more,we will
get this error(check above example).but if we limit the rows and columns to a
small number,It does not have problem.

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