title: JavaFx: Export TableView to excel with name of columns
body: <p>I'm trying to export <code>tableView</code> to excel using <a href="http://poi.apache.org" rel="nofollow noreferrer">Apache POI</a></p>
  
  <p>Every thing is well but I need export all my table not just items, I mean with columns names when I use this code: </p>
  
  <pre><code>HSSFWorkbook workbook = new HSSFWorkbook();
  HSSFSheet spreadsheet = workbook.createSheet("sample");
  
  HSSFRow row = null;
  
  for (int i = 0; i &lt; TousEmpSusp.getItems().size(); i++) {
      row = spreadsheet.createRow(i);
      for (int j = 0; j &lt; TousEmpSusp.getColumns().size(); j++) {
          row.createCell(j).setCellValue(TousEmpSusp.getColumns().get(j).getCellData(i).toString());
      }
  }
  </code></pre>
  
  <p>it exports only items, I tried to modify it like this: </p>
  
  <pre><code>   for (int j = 0; j &lt; TousEmpView.getColumns().size(); j++) {
              row.createCell(j).setCellValue(TousEmpView.getColumns().get(j).getText());
  
          }
          for (int i = 0; i &lt; TousEmpView.getItems().size(); i++) {
              row = spreadsheet.createRow(i+1);
              for (int j = 0; j &lt; TousEmpView.getColumns().size(); j++) {
                  row.createCell(j).setCellValue(TousEmpView.getColumns().get(j).getCellData(i).toString());
              }
          }
  </code></pre>
  
  <p>but it invokes <code>IndexOutOfBoundsException</code>. 
  So how can I export <code>tableView</code> with column names? What should I modify?</p>