BIRT Exchange Forum: Invalid formula syntax. when using setDefinedName - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Invalid formula syntax. when using setDefinedName Failure using setDefinedName to name a cell Rate Topic: -----

#1 User is offline   meindert Icon

  • Junior Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 05-December 08


Post icon  Posted 29 November 2011 - 03:44 AM

I have a strange issue with setDefinedName on a excel 2003 template.
The function works when using a blank excel sheet, but when I copy and past a sheet from excel 2010 it doesn't.
I have removed this sheet from the template but still the function is not working.
Attached is the 'corrupted' excel template. Can anybody debug the setDefinedName function to figure out why this is happening?

Here is my junit test case:
public class Actuate extends TestCase {
	
	@Test 
	public void testExcel2003(){
		File exceltemplate = new File("C:/Source Code/eclipse/esos/war/reports/blank.xls");
		Document doc=null;
		try {
			doc = new Document(new Group(), exceltemplate, null);
			doc.getBook().setAutoRecalc(false);
			CellFormat cf = doc.getBook().getCellFormat(0, 0, 0, 0, 0, 0);
			BookModel book = BookModel.Factory.create(doc.getBook());

			book.setDefinedName("NAMEDCELL", "'Sheet1'!$B$2");
		}catch(Exception ex){
			ex.printStackTrace();
		}
	}
}

Attached File(s)


0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users