Hi Yehor,

I have to build a workbook with one sheet and 16500rows x 30cells, but it's
don't !

This is a servlet' Tomcat and around 10000rows the process stop (out of
memory).

I'm use :
Eclipse 3.2
Tomcat 5.0.18
Win XP Pro 2002 SP2
3 Ghz 1Go

My JVM configuration :
-vmargs
-Xms512m
-Xmx512m
-XX:PermSize=512m
-XX:MaxPermSize=512m



The code :

public void addAResulset(ArrayList aResulset, int startLine) {
    for (int line = 0; line < aResulset.size(); line++) {
      addRow((ArrayList)aResulset.get(line), startLine + line, null);
    }
}

public void addRow(ArrayList rowData, int numLigne, HSSFCellStyle cellStyle)
{
    SimpleDateFormat formatDateFR = new SimpleDateFormat("dd/MM/yyyy");
    Timestamp typeDate = new Timestamp(0);
    BigDecimal typeNumber = new BigDecimal(0);

    HSSFRow row = null;
    HSSFCell cell = null;

    row = this._sheet.createRow(numLigne);

    for (int i = 0; i < rowData.size(); i++) {
      cell = row.createCell((short) i);

      if (cellStyle != null) {
        cell.setCellStyle(cellStyle);
      }

      Object object = (Object)rowData.get(i);

      if (object != null) {
        if (object.getClass().isInstance(typeDate)) {
          Date date = (Date)object;
          cell.setCellValue(new HSSFRichTextString(formatDateFR.format
(date)));
        } else if (object.getClass().isInstance(typeNumber)) {
          Number number = (Number)object;
          cell.setCellValue(number.doubleValue());
        } else {
          cell.setCellValue(new
HSSFRichTextString(((String)object).trim()));
        }
      } else {
        cell.setCellValue(new HSSFRichTextString(""));
      }
    }
  }


Any idea or information ?
Thanks

Regards

Chris

Reply via email to