1

I am trying to use the jOpenDocument library to create documents. I have executed the example where it creates a spreadsheet - the code compiles and runs OK but when I tried to open the document with Excel Office 2012 or with Google Docs they indicated to me that the format is incorrect.

This is the example, i am using the version 1.2 of jOpenDocument:

final Object[][] data = new Object[6][2];
data[0] = new Object[] { "January", 1 };
data[1] = new Object[] { "February", 3 };
data[2] = new Object[] { "March", 8 };
data[3] = new Object[] { "April", 10 };
data[4] = new Object[] { "May", 15 };
data[5] = new Object[] { "June", 18 };

String[] columns = new String[] { "Month", "Temp" };

TableModel model = new DefaultTableModel(data, columns);

// Save the data to an ODS file and open it.
final File file = new File(destpath, "temperature.ods");

SpreadSheet.createEmpty(model).saveAs(file);
Rubén
  • 34,714
  • 9
  • 70
  • 166
dlopezgonzalez
  • 4,217
  • 5
  • 31
  • 42

1 Answers1

0

Ok. With versión 1.3b1 (or above), Excel 2010 can open the file.

But Google Docs still cant.

dlopezgonzalez
  • 4,217
  • 5
  • 31
  • 42