Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

New Post: Date vs. Numeric NPOI 2.0.6

$
0
0
if (cell.CellType == CellType.Numeric)
{
 object[targetRowNum, targetColNum] = cell.NumericCellValue.ToString();
 if (DateUtil.IsCellDateFormatted(cell))
 {
     object[targetRowNum, targetColNum] = cell.DateCellValue.ToString("dd-MMM-yyyy");
 }
}

note: you need to use wb = WorkbookFactory.Create(filestream,ImportOption.All); ImportOption.All parameter allows DateUtil.IsCellDateFormatted to work properly.

Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>