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

New Post: Why did you implement a different behaviour in XSSFWorkbook and HSSFWorkbook?

$
0
0
For example, setting background color. For the HSSFWorkbook item:
                HSSFWorkbook workbook = ... // getting workbook
                ...
                var pallete = workbook.GetCustomPalette();
                var color = pallete.FindSimilarColor(_backgroundColor.R, _backgroundColor.G, _backgroundColor.B);
                if (color != null)
                {
                    var colorIndex = color.GetIndex();
                    _poiCell.CellStyle.FillBackgroundColor = colorIndex;
                }
And for the XSSFWorkbook item:
            XSSFCellStyle style =... // getting cells style
            ...
            style.FillBackgroundXSSFColor = new XSSFColor(_backgroundColor);
            style.FillPattern = FillPattern.SolidForeground;

Viewing all articles
Browse latest Browse all 1621

Trending Articles



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