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=34021>.
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=34021





------- Additional Comments From [EMAIL PROTECTED]  2005-04-22 14:42 -------
(In reply to comment #1)
> Can someone confirm that excel accepts sheet names with dots and spaces. I'll
> fix this then. 

This does not appear to be a bug. The line in bug report:
          cell.setCellFormula("Sheet 1!A1");
is incorrect. It should be:
          cell.setCellFormula("'Sheet 1'!A1");
(Use single quotes around sheet name containing spaces/dots, thats how excel
does it anyway) If you dont use single quotes in formula, even excel complains
and throws up :)

Following is example of code that works:

public static void main(String[] args) {
 HSSFWorkbook sb = new HSSFWorkbook();
 HSSFSheet sheet = sb.createSheet("Sheet a.1");
 sheet = sb.createSheet();
 sheet.createRow(1).createCell((short) 2).setCellFormula("'Sheet a.1'!A1");
 sb.write(new FileOutputStream("/somedir/test34021.xls"));
 // close the FileOutputStream...
}



-- 
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: [EMAIL PROTECTED]
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/

Reply via email to