Hi,

I've a litte problem using the setFormula()-method.

See the following code:

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.nio.file.*;

import org.jopendocument.dom.spreadsheet.MutableCell;
import org.jopendocument.dom.spreadsheet.SpreadSheet;

public class SheetTest {

 private String path;
 private File classlist;

 public SheetTest(String path) {

  this.path = path;

try {
// Save the data to an ODS file and open it.
this. classlist  = new File(path);

SpreadSheet temp = SpreadSheet.createFromFile( classlist );
  temp.getSheet(0).getCellAt(1, 1).setFormula("=IF(C8<8;5;9)");
    

  temp.saveAs(new File(path));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

public static void main(String[] args) {
// TODO Auto-generated method stub
SheetTest sheettest = new SheetTest(
  "path to the *.ods-file");

}

}


Everything works fine execpt the formula as it is written in small letters 
"if" and not, as proposed, in capital IF.

The content of cell (1,1) is  =if(C8<8;5;9) and OO 4.1 displays an error 
"#name?" 

This seems to be very strange as the "C8" is set correctly in capital 
letters...

Any ideas?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to