In Excel, I can have multiple text styles in a single cell. Is there a way to create a file like this using JExcelApi? I'm not seeing anything so far: setCellFormat is a method on WritableCell, and there doesn't seem to be any way to set a format for anything within a single cell.
Am I just missing it (quite possible!), or is this not implemented?
As a bonus: how hard would this be to implement? Is there any other Excel-export library which does implement this, from which I could borrow the code?
With variables
WritableSheet ws, int col, int row
The following code will set your cell's font to bold.
A CellFormat/WritableCellFormat contains lots of different formatting options, such as the font, borders, background colour and wrap.
So, yes. You were just missing it :p
EDIT: As I didn't make it clear enough, for multiple styles you can call multiple methods on your
WritableFont
, e.gsetBoldStyle()
,setItalic()
,setUnderlineStyle()
,setStruckout()
,setColour()
, etc.@Cosmic There is another way to read that question: multiple formats in separate areas of a single cell.
Like: "Italics Bold Text" with "italics" and "bold" set in different style, i.e. bold not italics, respectively.
Can this be done in JExcelAPI? I am not aware of this. Anyone?