Le 29/04/2013 12:38, QozbroQqn a écrit :
HelloI have a sheet with around 5000+ data cells, mainly double values. I have inserted a few functions, for example SUM(a1:a2000). With jopendoc I put new data into these cells but when I am starting the ods in libreoffice calc, the sum has still the old value from the data before. This is a really annoying thing because I have to refresh all those cells manually. It does not work with "F9" means refresh table content. Also the automatic calculating option does not do the trick. To get the right sum, I have to rewrite the function. For 20+ functions, it is the pain in the ass. Is there a method I did not found yet what refreshes the table content after putting in the values?
Hi,jOpenDocument cannot execute OpenDocument formulas, but from my testing LibreOffice automatically updates values upon opening. If you open the attached file, you'll see A4 contains =SUM(A1:A3) which is 6. In the following code, I change the A1 cell to -3 and when the file opens in LibreOffice the sum is updated, i.e. A4 is 2. I have LO 3.6.5, may be you have another version ?
public static void main(String[] args) throws Exception {
final Sheet sheet = ODPackage.createFromFile(new
File("Update.ods")).getSpreadSheet().getFirstSheet();
System.err.println("A4 is " + sheet.getValueAt("A4"));
sheet.setValueAt(-3, 0, 0);
OOUtils.open(sheet.getODDocument().saveAs(new
File("UpdateSpreadsheet-out")));
}
Cheers,
Sylvain
--
---
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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
Update.ods
Description: application/vnd.oasis.opendocument.spreadsheet
