You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2007/12/19 03:12:23 UTC

DO NOT REPLY [Bug 44098] New: - About Excel Formula After l

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


DO NOT REPLY [Bug 44098] - About Excel Formula can NOT calculate itself, but version 2.5 is OK

Posted by bu...@apache.org.
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


huxin0124@yahoo.com.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|About Excel Formula can NOT |About Excel Formula can NOT
                   |calculate itself after load |calculate itself, but
                   |and export to another       |version 2.5 is OK




-- 
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


DO NOT REPLY [Bug 44098] - About Excel Formula can NOT calculate itself after load and export to another

Posted by bu...@apache.org.
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


huxin0124@yahoo.com.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|About Excel Formula After l |About Excel Formula can NOT
                   |                            |calculate itself after load
                   |                            |and export to another




-- 
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


DO NOT REPLY [Bug 44098] - About Excel Formula can NOT calculate itself, but version 2.5 is OK

Posted by bu...@apache.org.
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


nick@torchbox.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Additional Comments From nick@torchbox.com  2007-12-21 04:21 -------
With POI 3.x, you can evaluate the formulas yourself, to have them re-calculate
to match changes in your spreadsheet

See http://poi.apache.org/hssf/eval.html

-- 
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