title: Writing from ArrayList to Excel sheet ListIterator
body: <p>I got an ArrayList which holds information on employees such as fName, sName and adress. I am writing this to an Excel workbook using apache poi.</p>
  
  <p>In the excel sheet I want all the information on one employee to come in the same row. I manage to write the first name in row 1 and cell 0 (row 0 holds headings). Everything is in vertically good order. When trying to add surname everything starts to jump here and there.</p>
  
  <p>How do I get the sName written in the right place?</p>
  
  <p>Here is part of my excel code</p>
  
  <pre><code>private void writeEmployeeInfo() {
  
      ListIterator&lt;Employee&gt; employeeListIterator = Employee
              .getEmployeeList().listIterator();
  
      int rowIndex = 1;
      int cellIndex = 0;
  
  
      while (employeeListIterator.hasNext()) {
  
          Employee employee = employeeListIterator.next();
  
          Row row = sheet.createRow(rowIndex++);
  
          Cell cell = row.createCell(cellIndex);
  
          cell.setCellValue(employee.getfName());
  </code></pre>
  
  <p>// trying to add surname of employees in the right cell.</p>
  
  <pre><code>            while(employeeListIterator.hasNext()){
              Employee emp = employeeListIterator.next();
              row = sheet.createRow(rowIndex++);
              cell = row.createCell(cellIndex++);
              cell.setCellValue(emp.getsName());
          }
      }
  }
  </code></pre>
  
  <p>This is my first post here, so if I have written or done things i a poor manner, please tell me what to do so it will be easy for you people to understand my question.</p>
  
  <p>Here is a link to the project if you need to see more code: <a href="http://1drv.ms/1kSGfDm" rel="nofollow">http://1drv.ms/1kSGfDm</a></p>