Some ODFDOM Samples
- developer / src / test / java / org / odftoolkit / odfdom
- svn/ trunk/ ConversionTools4/ src/ np/ org/ mpp/ conv4/ utils/ odfdom/
odf4j sample
Here´s the modified code which actually works:
package org.openoffice.odf.tools;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;
import org.openoffice.odf.spreadsheet.SpreadsheetDocument;
public class Test {
public static void main(String[] args) throws Exception {
SpreadsheetDocument doc = new SpreadsheetDocument();
DefaultTableModel model = new DefaultTableModel();
model.addColumn("Column A");
model.addColumn("Column B");
Vector row = new Vector();
row.add( "foo" );
row.add( new Integer( 1 ) );
model.addRow( row );
doc.addSpreadsheet( "Test1", model, false );
doc.deleteSpreadsheet("Sheet1");
doc.save( "test.ods" );
doc.close();
}
}
jOpenDocument A pure Java library for OASIS Open Document files manipulation
0 件のコメント:
コメントを投稿