Try this...

         HSSFCellStyle altRow = workbook.createCellStyle();
         altRow.setFillForegroundColor(HSSFColor.AQUA.index);
         altRow.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);

      if((rownum % 2) == 1) {
            cell.setCellStyle(altRow);
      }







suriz4u wrote:
> In my application there is requirement that alternative rows should be
> colored.As iam using different styles for different
> objects(Ex:Long,Integer,Float etc..).I tried to use in following way for
> different objects
>
>  HSSFCellStyle csDouble= wb.createCellStyle();
>   if(!(rowNumber%2==0))
>       { csDouble.setFillForegroundColor(HSSFColor.AQUA.index);
>         csDouble.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);}
>
>
> But to my surprise i got all the rows with same color.Iam really
confused.
> Can any one help me out please..............
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to