0

changing cell format from General to Custom datetime format but I want excel date format

How can I achieve this .Currently I am using NPOI library of C#

NPOI.SS.UserModel.ICellStyle dateSecondBlackCellStyle = setdateRowStyle(currentWorkBook, false);
dateSecondBlackCellStyle.DataFormat = createHelper.CreateDataFormat().GetFormat("MMM/dd/yyyy");

currentRow.GetCell(columnIndex).CellStyle = dateSecondBlackCellStyle;
currentRow.GetCell(columnIndex).CellStyle.DataFormat = dateBlackCellStyle.DataFormat;

I am using this code to set dataformat of datecell while generating report

  • Would be better if we see your work and what do you want as a result.. – Soner Gönül Jan 19 '15 at 09:13
  • NPOI.SS.UserModel.ICellStyle dateSecondBlackCellStyle = setdateRowStyle(currentWorkBook, false); dateSecondBlackCellStyle.DataFormat = createHelper.CreateDataFormat().GetFormat("MMM/dd/yyyy");currentRow.GetCell(columnIndex).CellStyle = dateSecondBlackCellStyle; currentRow.GetCell(columnIndex).CellStyle.DataFormat = dateBlackCellStyle.DataFormat; – Bhupinder Rajput Jan 19 '15 at 09:24
  • Is this Window App or Web App code – Shubhojit Jan 19 '15 at 10:08

0 Answers0