Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.     public void creaExcelElencoAdcEmail(Iterator<ExportExcel> iter, int righeTotali)  throws Exception
  2.     {
  3.         HSSFSheet sheet = wb.getSheetAt(0);
  4.         int rowNum = 2;
  5.         while(iter.hasNext())
  6.         {
  7.             ExportExcel istanza = iter.next();
  8.             HSSFRow row = sheet.createRow(rowNum);
  9.             int i=1;
  10.             row.createCell(i++).setCellValue(istanza.getCodAssociazione());
  11.             row.createCell(i++).setCellValue(istanza.getDescrizione());
  12.             row.createCell(i++).setCellValue(istanza.getEmail());
  13.             rowNum++;
  14.         }
  15.         for(int columnPosition = 1; columnPosition< 6; columnPosition++) {
  16.             sheet.autoSizeColumn((short) (columnPosition));
  17.         }
  18.  
  19.         wb.write(stream);
  20.        
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement