We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Getting a white font on Black color cells

Hi ,

I am using a trial version of Aspose cells for java. I am trying to get White color fonts over black color cells. Below is the code I am using.

Style styleOfPeriodHeader = workbook.createStyle();

styleOfPeriodHeader.setTextWrapped(true);

Font font1 = styleOfPeriodHeader.getFont();

font1.setName("Times New Roman");

font1.setColor(Color.getWhite());

font1.setSize(14);

font1.setBold(true);

Pleas ele tme know if I am missing anyhting here.

Hi,


Well, you need to specify your style object (e.g “styleOfPeriodHeader” with your desired attributes) to your desired cells using e.g …cell.setStyle(styleOfPeriodHeader) using your code snippet.

Please see the document for your complete reference:
http://www.aspose.com/docs/display/cellsjava/Dealing+with+Font+Settings

Thank you.

Thanks for the response. I forgot to mention that code as well. I am doing this like mentioned below, but still it is not working. Can it be becasue of licensing issue?

headercell=cells.get(RowIndex-1, periodcolumnCounter);

headercell.setStyle(styleOfPeriodHeader);

periodcolumnCounter++;

Hi,


No, your issue should not be linked to licensing, your code might have an issue or so.
Please provide us your runnable sample code or JAVA program with your template file, so that we could evaluate your issue properly to help you to figure it out soon.

Thank you.

Hi,

Attached is the smaple code i created for this issue. You can execute the class TestingPurpose.java.

The years 2007, 2008, 2009 and 2010 should come as white font and black cells.

Thanks This works,

However I wanted to know why it didnt worked earlier. Is there an official documentation that can help me understand this issue?

Regards,

Abhinav

Hi,


We recommend you to kindly see the document for your complete reference on the process i.e…, how Smart Markers are defined in the template Excel file and then processed to fill data based on the markers:
http://www.aspose.com/docs/display/cellsnet/Smart+Markers (This is for .NET version of the product but you may refer to it for your understanding)
http://www.aspose.com/docs/display/cellsjava/Smart+Markers

Hope, this helps you a bit.

Thank you.