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

New Post: How do I set the DataFormat for an entire column?

$
0
0

I'm having trouble setting the DataFormat on a column in a report.  I was hoping to use SetDefaultColumnStyle, but it doesn't appear to be working:

ICellStyle datetimeFormatStyle = workbook.CreateCellStyle();
datetimeFormatStyle.DataFormat = HSSFDataFormat.GetBuiltinFormat("m/d/yy h:mm");
sheet.SetDefaultColumnStyle(0, datetimeFormatStyle);

Unfortunately the dates are still appearing in the standard m/d/yy format.  The date date does have time stamps on it.  What am I doing wrong?  Or is it not possible to do this for an entire column?


Viewing all articles
Browse latest Browse all 1621

Trending Articles



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