Hi, Yegor.
I noticed there XSSFSimpleShape object it have a method called setText() who
takes XSSFRichTextString object for argument. How to use your example into
my code. I'll paste snippet of my code. I forgot to mention I using
*Microsoft Excel 2007*.
private void createExcelShape(XSSFWorkbook aWorkbook, XSSFDrawing
aPatriarch, int aShapeType,
XSSFClientAnchor aShapeLocation, Color aShapeColor,
XSSFFont aFont,
String aText) {
XSSFSimpleShape shape =
aPatriarch.createSimpleShape(aShapeLocation);
shape.setShapeType(aShapeType);
shape.setFillColor(aShapeColor.getRed(), aShapeColor.getGreen(),
aShapeColor.getBlue());
// Initialize border of the shape
shape.setLineStyleColor(0, 0, 0);
shape.setLineWidth(1);
shape.setLineStyle(HSSFShape.LINESTYLE_SOLID);
XSSFRichTextString noteText = new XSSFRichTextString();
if (aFont != null) {
// Initialize text of the shape
noteText.append(aText, aFont);
*shape.setText(noteText);*
} else if (aText != null) {
noteText.append(aText);
*shape.setText(noteText);*
}
}
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/How-to-align-text-in-the-shape-tp5711188p5711199.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]