Adding Custom colours to Excel sheet using Apache POI
Can anyone explain how to add Custom colours either using (rgb values or hex values ) to an excelsheet sheet(either in foreground or background) using Cellstyle in Apche poi to a Excelsheet(XSSF Workbook)? Setting custom colors depends on the kind of Excel file (Office Open XML format *.xlsx vs. BIFF format *.xls ). And it might be different using different versions of apache poi because of deprecation. Using Office Open XML format *.xlsx we can simply set new colors using constructor of XSSFColor . In apache poi 4.0.0 XSSFColor(byte[] rgb, IndexedColorMap colorMap) can be used.