title: NPOI Excel number format not showing in Excel sheet in asp.net
body: <p>I am trying to create double and number format cells in excel using NPOI library. I used code like</p>
  
  <pre><code>Dim cell As HSSFCell = row.CreateCell(j)
  cell.SetCellValue(Double.Parse(dr(col).ToString))
  </code></pre>
  
  <p>In excel numbers are aligning right but when I check format it is showing in "General"</p>
  
  <p><img src="https://i700.photobucket.com/albums/ww5/vsrikanth/2010-08-06_113236.jpg" alt="alt text"></p>
  
  <p>then I changed my code to like below</p>
  
  <pre><code> Dim cell As HSSFCell = row.CreateCell(j)
   cell.SetCellValue(Double.Parse(dr(col).ToString))
   Dim cellStyle As HSSFCellStyle = hssfworkbook.CreateCellStyle
   cellStyle.DataFormat = HSSFDataFormat.GetBuiltinFormat("#,#0.0")
   cell.CellStyle = cellStyle
  </code></pre>
  
  <p>Then While opening file it is giving error and also taking so long  to open. But Excel format showing in "Number"</p>
  
  <p>error showing is like below.</p>
  
  <p><img src="https://i700.photobucket.com/albums/ww5/vsrikanth/2010-08-06_114459.jpg" alt="alt text"></p>
  
  <p>How to fix this?</p>