How to add Symbols to the content in a cell

Hello,
Need assistance in adding a symbol (Geometric Shapes - Black Circle) to the content in a cell with Aspose Cells Java API.
Attached below the Sample excel file for reference: AddSymbolWithText.zip (39.0 KB)

Thanks in Advance

@SrideviG,

Thanks for the sample file with screenshot.

You may use corresponding unicode (hex) value for the Geometric shapes to input into the cell with the text value. See the following sample code for your reference:
e.g.
Sample code:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().get(0);

//Put your character value in cell A1
worksheet.getCells().get("A1").putValue("\u25CF" + " " +"Hello Aspose!");

Style style = workbook.createStyle();
style.getFont().setName("Segoe UI Symbol");
style.getFont().setCharset(2);
style.getFont().setSize(12);
style.getFont().setColor(com.aspose.cells.Color.getRed());

worksheet.getCells().get("A1").setStyle(style);
workbook.save("f:\\files\\out1.xlsx") ;

Hope, this helps a bit.

@amjad.sahi Thanks for the quick response.

The sample code is helpful.
How can we add the color only to the Shape, not the entire cell content

@SrideviG,

Good to know that the suggested code segment works for your needs.

You need to set your desired formatting (e.g., font color, etc.) to specific character(s) for your needs. See the document with example code for your reference.
https://docs.aspose.com/cells/java/data-formatting/#formatting-selected-characters

Also, I have written/updated the following sample code to accomplish your task for your reference:
e.g.
Sample code:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().get(0);

//Put your character with text in cell A1
worksheet.getCells().get("A1").putValue("\u25CF" + " " +"Hello Aspose!");
//Set formatting to the cell
Style style = workbook.createStyle();
style.getFont().setName("Segoe UI Symbol");
style.getFont().setCharset(2);
style.getFont().setSize(12);
worksheet.getCells().get("A1").setStyle(style);

//Set color only to the shape (first character, which is a shape).
com.aspose.cells.Font font = worksheet.getCells().get("A1").characters(0, 1).getFont();
//Set the font color of selected characters to red
font.setColor(com.aspose.cells.Color.getRed());

workbook.save("f:\\files\\out1.xlsx");

Hope, this helps a bit.