Hi Team, We are using Apache Poi 3.13 final jars. We used SXSSF workbook for an export of records using MS Xcel. Records are exporting but,Workbook's apply font method is not working and beacuse of this coloring of text in the excel columns is not at all working. Being low memory adaption technique in SXSSF work book,apply font wont work,i know this. But can u please suggest a working solution,without changing the SXSSF workbook? If any jar change may work,please suggest. Thanks a lot Ratna
This works for me. Adapted from https://poi.apache.org/spreadsheet/quick-guide.html#Hyperlinks CellStyle style = wb.createCellStyle(); Font font = wb.createFont(); font.setUnderline(Font.U_SINGLE); font.setColor(IndexedColors.BLUE.getIndex()); style.setFont(font); Sheet sheet = wb.createSheet(); Cell cell = sheet.createRow(0).createCell(0); cell.setCellValue("Underlined Blue Text"); cell.setCellStyle(style); In the future, please ask usage questions on the user or dev mailing lists rather than opening a bug. https://poi.apache.org/mailinglists.html
for the particular TEXT in Cell,i want coloring. Not the entire cell,if you have example provide me please.
Also U r saying example for XSSF workbook,i want to work it for SXSSF workbook,not XSSF work book
(In reply to Ratna from comment #2) > for the particular TEXT in Cell,i want coloring. > Not the entire cell,if you have example provide me please. Bugzilla is only for bug reports and patches. Please ask usage questions on the mailing list
The code from comment 1 was tested on a SXSSFWorkbook and colors the text (not background fill). Coloring part of the text in a cell requires RichTextStrings, which SXSSF does not currently support. Supporting this would require maintaining a shared strings table, negating some of the memory benefits of SXSSF. We will happily review submitted patches and unit tests for optionally allowing a shared strings table and rich text strings in SXSSF if they meet the needs of the community.
how Coloring of specific text in a particular cell is achieved in SXSSF work book? For example "I love you" in this string i want "you" to color with blue,how it is possible? is there any alternative for applyfont method? Please explain me if partial text coloring is possible with shared strings table,how it is achieved in the above example with a sample code bit. Thanks in advance
As Nick said in comment 4, bugzilla is not the place for usage questions. SXSSF does not currently support RichTextStrings, so it is not possible tohave multiple font colors in one cell in SXSSF. If you need RichTextStrings, you must use XSSF. Please read https://poi.apache.org/spreadsheet/quick-guide.html#RichText If you have further questions, please ask the user list https://poi.apache.org/mailinglists.html