Hello Nitesh,
It's a huge code but I will write the scenario:
while(iterator.hasNext()){
if(error == 1){
cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );
cellStyle.setFillForegroundColor(new
HSSFColor.RED().getIndex());
}else if(error == 2){
cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );
cellStyle.setFillForegroundColor(new
HSSFColor.YELLOW().getIndex());
}
createCell(dataSecDataRow, (short)4, iterator.next(),
cellStyle); //$Address(Hex)
cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );
cellStyle.setFillForegroundColor(new
HSSFColor.YELLOW().getIndex());
}//end while
private void createCell(HSSFRow row, short cellNum,
Object cellValue,
HSSFCellStyle cellStyle){
HSSFCell cell = row.createCell(cellNum); //Cell Number
cell.setCellStyle(cellStyle);
}
Regards,
------------------------------------------------------------------------
-------
Garima Agarwal
Advanced Software Engineer
Technology Application Group
DELPHI, Technical Center India
Board: 91-080-28412015/22 ext.125
-----Original Message-----
From: Nitesh [mailto:[EMAIL PROTECTED]
Sent: Monday, September 18, 2006 3:35 PM
To: POI Users List
Subject: Re: Not able to fill colors to a single row
Hi Garima,
Cud u attach the code.
Regards,
Nitesh Baranwal
----------------------------------
Member of Technical Staff
Persistent Systems Pvt Ltd.
Office : +91-20-30235744
----- Original Message -----
From: "Agarwal, Garima " <[EMAIL PROTECTED]>
To: "POI Users List" <[email protected]>
Sent: Monday, September 18, 2006 2:58 PM
Subject: Not able to fill colors to a single row
Hi,
I am trying to fill foreground color to few required row using the code
dataSecCellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );
dataSecCellStyle_SF.setFillForegroundColor(new
HSSFColor.DARK_YELLOW().getIndex());
and then for all the remaining rows I don't need this fill so I am
trying the code:
dataSecCellStyle.setFillPattern(HSSFCellStyle.NO_FILL);
at the end of the loop(i.e. before next row is written).
But when my excel file is open up, it has no fill at all, if I comment
this NO_FILL last line then all the rows are filled with color.
Any way out????
Garima.
************************************************************************
****************
Note: If the reader of this message is not the intended recipient, or
an
employee or agent responsible for delivering this message to the
intended
recipient, you are hereby notified that any dissemination, distribution
or
copying of this communication is strictly prohibited. If you have
received
this communication in error, please notify us immediately by replying to
the
message and deleting it from your computer. Thank you.
************************************************************************
****************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is
the property of Persistent Systems Pvt. Ltd. It is intended only for the
use of the individual or entity to which it is addressed. If you are not
the intended recipient, you are not authorized to read, retain, copy,
print, distribute or use this message. If you have received this
communication in error, please notify the sender and delete all copies
of this message. Persistent Systems Pvt. Ltd. does not accept any
liability for virus infected mails.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
****************************************************************************************
Note: If the reader of this message is not the intended recipient, or an
employee or agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to the message
and deleting it from your computer. Thank you.
****************************************************************************************