SOLID_FOREGROUND cannot be resolved or is not a field
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
Using 3.7 version of apache-poi
I am getting the following issue. Please help on this .
SOLID_FOREGROUND cannot be resolved or is not a field
Thanks, Govardhan
According to the javadoc from version 3.17 that field was removed.
Use FillPatternType.SOLID_FOREGROUND instead.
From source code of apache-poi 3.15 I can see:
/**
* Fill Pattern: Solidly filled
* @deprecated 3.15 beta 3. Use {@link FillPatternType#SOLID_FOREGROUND} instead.
*/
@Removal(version="3.17")
static final short SOLID_FOREGROUND = 1; //FillPatternType.SOLID_FOREGROUND.getCode();
You can use the org.apache.poi.ss.usermodel.FillPatternType. It has an attribute FillPatternType.SOLID_FOREGROUND or you can pass the value 1.
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
or
style.setFillPattern(1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With