poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44098] New: - About Excel Formula After l
Date Wed, 19 Dec 2007 02:12:23 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44098>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44098

           Summary: About Excel Formula After l
           Product: POI
           Version: 3.0-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P1
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: huxin0124@yahoo.com.cn
                CC: huxin0124@yahoo.com.cn


Dear all,
I use poi-bin-3.0.1-FINAL-20070705.
I found a strange thing that I load an xls file and export to another file 
without any operate, the new file formula can't calculate itself, but after i 
double click the formula cell, the value appeared.
my code:

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class ExcelTest
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		try
		{
			FileInputStream fis = new FileInputStream(new File
("123.xls"));
			HSSFWorkbook wb = new HSSFWorkbook(fis);
			fis.close();
			
			HSSFSheet sheet = wb.getSheetAt(0);
			HSSFRow row0 = sheet.getRow(0);
			HSSFRow row1 = sheet.getRow(1);
			HSSFRow row2 = sheet.getRow(2);
			
			short col1 = 0;
			HSSFCell cell1 = row1.getCell(col1);
			cell1.setCellValue(14.1);
			HSSFCell cell2 = row2.getCell(col1);
			cell2.setCellValue(16.1);
			
			FileOutputStream fos = new FileOutputStream(new File
("1234.xls"));
			wb.write(fos);
			fos.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
}
thank you all!
p.s. my excel version is 2003.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message