Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. /**
  2. * Created by craig on 09/12/16.
  3. */
  4. import java.net.URI;
  5.  
  6. import org.odftoolkit.simple.TextDocument;
  7. import org.odftoolkit.simple.table.Cell;
  8. import org.odftoolkit.simple.table.Table;
  9. import org.odftoolkit.simple.text.list.List;
  10. public class Main {
  11. public static void main(String[] args) {
  12. dataHandle.importer("JIRA.csv");
  13. }
  14.  
  15. public static void docbuild() {
  16. TextDocument outputOdt;
  17. try {
  18. outputOdt = TextDocument.newTextDocument();
  19.  
  20.  
  21. // add paragraph
  22. outputOdt.addParagraph("Hello World, Hello Simple ODF!");
  23.  
  24. // add list
  25. outputOdt.addParagraph("The following is a list.");
  26. List list = outputOdt.addList();
  27. String[] items = {"item1", "item2", "item3"};
  28. list.addItems(items);
  29.  
  30. // add table
  31. Table table = outputOdt.addTable(2, 2);
  32. Cell cell = table.getCellByPosition(0, 0);
  33. cell.setStringValue("Hello World!");
  34.  
  35. outputOdt.save("HelloWorld.odt");
  36. } catch (Exception e) {
  37. System.err.println("ERROR: unable to create output file.");
  38. }
  39. }
  40.  
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement