title: Unable to change Font Color of text while writing to excel file using Java
body: <p>I have a requirement to take the test data from Excel sheet and write test result as Pass/Fail in another Excel sheet.
  I am using SeleniumRC+Java+Eclipse+Junit.</p>
  
  <p>How can i change font color of text while writing to Excel sheet using Java.</p>
  
  <p>I am doing with the help of Label, WorkBook, WrittableWorkbook, WrittableSheet, Sheet.</p>
  
  <p>Here is my sample code..</p>
  
  <pre><code>import jxl.Sheet;
  import jxl.Workbook;
  import jxl.WorkbookSettings;
  import jxl.read.biff.BiffException;
  import jxl.write.Label;
  import jxl.write.WritableSheet;
  import jxl.write.WritableWorkbook;
  import jxl.write.WriteException;
  
  public class FinalTestSuite extends TestCase 
  {
  public static  File file = new File("C:/Selenium/selenium-remote-control-1.0.3/TestingResult.xls");
  public static  File sourceFile = new File("C:/Selenium/selenium-remote-control-1.0.3/Portland.xls");
  public static  WorkbookSettings ws;
  public static  WritableWorkbook workbook;
  public static  WritableSheet wSheet1, wSheet2;
  public static  Sheet sh1, sh2;
  public static  Sheet sheetFinal;
  public static  Workbook sourceWorkbook;
  public static  Label label;
  }
  
  
  public void getTestResult(String passOrfail) throws IOException,BiffException, WriteException
  
  {
  try
  {
  
  FinalTestSuite.file = new File("C:/Selenium/selenium-remote-control-1.0.3/TestingResult.xls");
  FinalTestSuite.sourceFile = new File("C:/Selenium/selenium-remote-control-1.0.3/TestDetails.xls");
  FinalTestSuite.ws = new WorkbookSettings();
  FinalTestSuite.workbook = Workbook.createWorkbook(FinalTestSuite.file, FinalTestSuite.ws);
                  FinalTestSuite.sourceWorkbook=Workbook.getWorkbook(FinalTestSuite.sourceFile);
  FinalTestSuite.sh1 = FinalTestSuite.sourceWorkbook.getSheet(0);
  FinalTestSuite.sh2= FinalTestSuite.sourceWorkbook.getSheet(1);
  FinalTestSuite.wSheet1 = FinalTestSuite.workbook.importSheet("Begin", 0 , FinalTestSuite.sh1);
  FinalTestSuite.wSheet2 = FinalTestSuite.workbook.importSheet("Reports", 0 , FinalTestSuite.sh2);
  colCount = FinalTestSuite.wSheet2.getColumns();
  
  rowCount = FinalTestSuite.wSheet2.getRows();
  
                  for(col=1;col&lt;=colCount;col++)
                  {
  
                      for(row = 1;row&lt;=rowCount;row++)
                      {
                          jxl.Cell dataCell =  FinalTestSuite.wSheet2.getCell(col, 0);
  
                          if(clientName.equals(client))
                          {
                              FinalTestSuite.label = new Label(col, row, passOrfail);
                              FinalTestSuite.wSheet2.addCell(FinalTestSuite.label);
                              break;                          
  
  
                          }
  
                      }
                  }
  
          }
          catch(Exception e)
          {
               e.printStackTrace();
          } 
  </code></pre>
  
  <p>Please anybody tell me how can i modify it to get Test result with font color as red and green...</p>