Bug 13617 - DataFormats with dollar signs don't work
Summary: DataFormats with dollar signs don't work
Status: RESOLVED DUPLICATE of bug 13248
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-dev
Hardware: PC All
: P3 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-14 21:32 UTC by Kevin Klein
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***