Bug 13617

Summary: DataFormats with dollar signs don't work
Product: POI Reporter: Kevin Klein <kklein>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED DUPLICATE    
Severity: major    
Priority: P3    
Version: 2.0-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Kevin Klein 2002-10-14 21:32:33 UTC
This sample code does not produce the expected result (value is present in the 
cell but not visible).

import java.io.*;
import org.apache.poi.hssf.usermodel.*;

public class Test {

   public Test() {
   }

   public static void main(String[] args) {
      try {
         FileOutputStream out = new FileOutputStream("test.xls");

         HSSFWorkbook workbook = new HSSFWorkbook();
         HSSFSheet sheet = workbook.createSheet("Test");
         HSSFRow row = sheet.createRow(0);
         HSSFCell cell = row.createCell((short)0);
         HSSFDataFormat fmt = workbook.createDataFormat();
         HSSFCellStyle style = workbook.createCellStyle();
         style.setDataFormat(fmt.getFormat("$#,##0"));
         cell.setCellStyle(style);
         cell.setCellValue(1234.56);
         workbook.write(out);

         out.close();
      }
      catch (Throwable t) {
         t.printStackTrace();
      }
   }
}
Comment 1 Shawn Laubach 2002-10-14 21:39:27 UTC
What exact version are you using?  If it is a nightly release, what is the date 
you got it?  I tested it against the current version and everything checks 
out.  There was a bug that was fixed about a week or so ago that would give 
these results.
Comment 2 Kevin Klein 2002-10-14 21:52:06 UTC
I am using the 1.8.0-dev-bin release.  Just downloaded it today, in fact.
Comment 3 Shawn Laubach 2002-10-14 21:54:45 UTC
That's the problem.  This is a duplicate of 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13248 and has been fixed in 
the current nightly builds.

*** This bug has been marked as a duplicate of 13248 ***