title: autosizeColumn() method error in apache-poi
body: <p><strong>I am unable to use autosizecolumn().
   Actually I am not getting where to write this autosizecoloumn() method though I got all data printed on xls file and now my only requirement is to set autosizecolumn.</strong> </p>
  
  <p>I have used addmergeredregion on top-left and on top-right company logo and table data below both.</p>
  
  <p><strong>For Column header</strong></p>
  
  <pre><code>                   short mainrow=10;
  
  
                          row=sheet.createRow(mainrow);
                          cell= row.createCell((short)0);
                          cell.setCellValue(new HSSFRichTextString("Sr.No."));
                          cell.setCellStyle(header);
  
                          sheet.autoSizeColumn((short)0);                 
  
                          cell= row.createCell((short)1);
                          cell.setCellValue(new HSSFRichTextString("Town_Code"));
                          cell.setCellStyle(header);
  
                          cell= row.createCell((short)2);
                          cell.setCellValue(new HSSFRichTextString("Town_Name"));
                          cell.setCellStyle(header);
  
                          cell= row.createCell((short)3);
                          cell.setCellValue(new HSSFRichTextString("State_Name"));
                          cell.setCellStyle(header);
  
                          cell= row.createCell((short)4);
                          cell.setCellValue(new HSSFRichTextString("Country_Name"));
                          cell.setCellStyle(header);
  </code></pre>
  
  <p><strong>Fill data into XLS</strong></p>
  
  <pre><code>                        short cellnum;
                          Integer srno=1;
                          for(Town town : townList){
                          row=sheet.createRow(++mainrow);
                          cellnum=0;
                          cell= row.createCell(cellnum++);
                          cell.setCellValue(srno++);
                          cell.setCellStyle(dataformat);
  
                          cell= row.createCell(cellnum++);
                          cell.setCellValue(new HSSFRichTextString(town.getTownCode()));
                          cell.setCellStyle(dataformat);
                          cell= row.createCell(cellnum++);
                          cell.setCellValue(new HSSFRichTextString(town.getName()));
                          cell.setCellStyle(dataformat);
                          cell= row.createCell(cellnum++);
                          cell.setCellValue(new HSSFRichTextString(town.getStateName()));
                          cell.setCellStyle(dataformat);
                          cell= row.createCell(cellnum++);
                          cell.setCellValue(new HSSFRichTextString(town.getCountryName()));
                          cell.setCellStyle(dataformat);
  
                          }
  
                          workbook.write(reportOutBuffer);
                          reportOutBuffer.close();
                          printNewReport(request, resp, reportOutBuffer.toByteArray(), "application/xls" ,"Town_Report_2013.");
  </code></pre>