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

Commented Unassigned: EXCEL 2013 - Date Format from row 10 [13144]

$
0
0
Hi, I'm using the NPOI 2.0 Version of your library, and I'm having an issue when creating an Excel file and try to open with Microsoft Excel 2013.

There is a column with date format, that works fine from row 1 to 10, but from row 11 the program stops reading this property and shows a weird decima value.

The llibrary works perfect for me in older versions of Excel, OpenOffice and GoogleDrive.

I attach a screenshot.

Thanks and regards!

Alejo
Comments: ** Comment from web user: applepie89 **

for additional information, I use this code to apply the style:

First I Defined the style I want to apply:
```
HSSFFont fontStyleSubject = (HSSFFont)xlsWorkbook.CreateFont();
fontStyleSubject.Boldweight = (short)FontBoldWeight.BOLD;
ICellStyle cellStyleSubject = xlsWorkbook.CreateCellStyle();
cellStyleSubject.SetFont(fontStyleSubject);
short colorIndex = new HSSFColor.GREY_25_PERCENT().GetIndex();
cellStyleSubject.FillForegroundColor = colorIndex;
cellStyleSubject.FillPattern = FillPatternType.SOLID_FOREGROUND;
```

after that, I have the following:
```
if (cellIsHeader)
{
wbCell.SetCellValue(cellValue);
wbCell.CellStyle = cellStyleSubject;
}
```

the strange thing is, as you can see in the attachment (difference), I also have a borderstyle, and this behaves correctly on all the rows as you can see, the code for this is nothing more then:

defining the style:
```
ICellStyle borderStyle = xlsWorkbook.CreateCellStyle();
borderStyle.BorderBottom = BorderStyle.THIN;
borderStyle.BorderRight = BorderStyle.THIN;
```

and if none of the if/else if's apply on a row, this code is applied:
else
```
{
wbCell.CellStyle = borderStyle;
}
```


Viewing all articles
Browse latest Browse all 1621

Trending Articles



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