title: Excel Cell Format - XSSF Workbook
body: <p>This is my code so far, it gets data from a query then exports it into an Excel document:</p>
  
  <pre><code>&lt;cfscript&gt;
    oArray = CreateObject("java", "java.util.Arrays");
    workbook = CreateObject("java", "org.apache.poi.xssf.usermodel.XSSFWorkbook");
    workbook.init();
  
    myFont = workbook.createFont();
    myFont.setBoldweight(myFont.BOLDWEIGHT_BOLD);
  
    boldStyle = workbook.createCellStyle();
    boldStyle.setFont(myFont);
  &lt;/cfscript&gt;
  
  &lt;!--- Set up the headings for the Excel worksheet ---&gt;
    &lt;cfscript&gt;
      thisSheet = workbook.createSheet(JavaCast("string", 'invoices due'));
      rows = {};
      // we need to refer to these three rows later on
      rows[1] = thisSheet.createRow(0);
      rows[2] = thisSheet.createRow(1);
      rows[3] = thisSheet.createRow(2);
      rows[4] = thisSheet.createRow(3);
  
      //Report parameters explanation
      thisCell = rows[2].createCell(0, 1);
      thisCell.setCellValue(reportSum);
  
      // user column headings
      thisCell = rows[4].createCell(0, 1);
      thisCell.setCellValue('Value');
      thisCell.setCellStyle(boldStyle);
      thisCell = rows[4].createCell(1, 1);
      thisCell.setCellValue('Team');
      thisCell.setCellStyle(boldStyle);
      thisCell = rows[4].createCell(2, 1);
      thisCell.setCellValue('Manager');
      thisCell.setCellStyle(boldStyle);
    &lt;/cfscript&gt;
  
  &lt;cfset row = 5&gt;
  &lt;cfloop query="invoicesDue"&gt;
  
  &lt;cfscript&gt;
     thisRow = thisSheet.createRow(JavaCast("int", row));
     thisCell = thisRow.createCell(0, 1);
     thisCell.setCellValue(HTMLEditFormat(invoicesDue.value));
     thisCell = thisRow.createCell(1, 1);
     thisCell.setCellValue(HTMLEditFormat(invoicesDue.ct_team));
     thisCell = thisRow.createCell(2, 1);
     thisCell.setCellValue(HTMLEditFormat(invoicesDue.manager));
     thisCell = thisRow.createCell(3, 1);  
   &lt;/cfscript&gt;
   &lt;/cfloop&gt;
  
  &lt;cfscript&gt;
   // todo: change to datadir from getAppRoot
   outputFileName = "invoicesDue(withfundingsource)" &amp; "_" &amp; RandRange(00000,99999) &amp; ".xlsx";
   fos = CreateObject("java", "java.io.FileOutputStream");
   fos.init(outputFilename);
   workbook.write(fos);
   fos.close();
  &lt;/cfscript&gt;
  </code></pre>
  
  <p>What I am trying to do is to format the column that is titled 'Value' to the data format 'Accounting' in Excel. I have done research but I am quite stuck.</p>
  
  <p>Any ideas?</p>