Replies: 1 comment
-
|
You could try the following implementation (Please refer to: https://fesod.apache.org/docs/sheet/write/style#code-example-2): public class PartialRedTextHandler implements CellWriteHandler {
@Override
public void afterCellDispose(CellWriteHandlerContext context) {
if (BooleanUtils.isNotTrue(context.getHead())) {
WriteCellData<?> cellData = context.getFirstCellData();
WriteCellStyle writeCellStyle = cellData.getOrCreateStyle();
writeCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
writeCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
writeCellStyle.setWrapped(true);
if (context.getCell().getCellType() == CellType.STRING) {
WriteFont writeFont = new WriteFont();
writeFont.setColor(IndexedColors.RED.getIndex());
writeCellStyle.setWriteFont(writeFont);
}
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
public class PartialRedTextHandler implements CellWriteHandler {
}
Beta Was this translation helpful? Give feedback.
All reactions