cell.setBackGroundColor not working

I am doing a style.setBackGroundColor(Color.getYellow())

and the output does not reflect the color. BUt if I add

style.setPattern(BackgroundType.VERTICAL_STRIPE); it is working. I need a solid pattern i tried BackgroundType.SOLID as well but no luck. Can you please suggest.

Thanks.

Hi,

Please use style.setForegroundColor() instead of style.setBackgroundColor(); so your code should look like now

i.e

style.setForegroundColor(Color.getYellow());

I get the same issue with setForegroundColor as well.

Thanks.

Hi,


You also need to specify the pattern (Solid type) while using setForegroundColor() method,
e.g…,

style.setForegroundColor(Color.getYellow());
style.setPattern(BackgroundType.SOLID);


Thank you.

That worked. Thanks