Package org.odftoolkit.simple

Examples of org.odftoolkit.simple.SpreadsheetDocument.save()


      Assert.assertTrue(chart.isUseLegend() == false);
      chart.setChartTitle("Chart with local-data");
      chart.setUseLegend(false);
      Assert.assertEquals(chart.getChartTitle(), "Chart with local-data");
      Assert.assertFalse(chart.isUseLegend() == true);
      doc.save(ResourceUtilities.newTestOutputFile(CHART_FILE1));

      Document doc1 = Document.loadDocument(ResourceUtilities.getTestResourceAsStream(CHART_FILE1));
      Assert.assertEquals(doc1.getMediaTypeString(), Document.OdfMediaType.SPREADSHEET.getMediaTypeString());
      doc = (SpreadsheetDocument) doc1;
View Full Code Here


      Chart chart8 = doc.getChartById(chartID8.getChartID());
      chart8.setChartType(ChartType.AREA);
      Assert.assertEquals(ChartType.AREA, chart8.getChartType());
      //Assert.assertEquals(8, doc.getChartByTitle(barTitle).size());
      Assert.assertNotNull(doc.getChartByTitle(areaTitle));
      doc.save(ResourceUtilities.newTestOutputFile(CHART_FILE2));
     
    } catch (Exception e) {
      Logger.getLogger(DataSetTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
    }
View Full Code Here

      NodeList tablelist = dom.getElementsByTagNameNS(OdfDocumentNamespace.TABLE.getUri(), "table");
      for (int i = 0; i < tablelist.getLength(); i++) {
        mOdsTable = (TableTableElement) tablelist.item(i);
        testAppendRow(mOdsTable);
      }
      odsDoc.save(ResourceUtilities.newTestOutputFile("TestODSAppendRowOutput.ods"));

      TextDocument odtDoc = TextDocument.loadDocument(ResourceUtilities
          .getTestResourceAsStream("TestODTAppendRow.odt"));
      dom = odtDoc.getContentDom();
      tablelist = dom.getElementsByTagNameNS(OdfDocumentNamespace.TABLE.getUri(), "table");
View Full Code Here

      String barTitle = "Bar Chart with CellRange ";
      String areaTitle = "AREA Chart with CellRange";
      doc.deleteChartByTitle(barTitle);
      Assert.assertNotNull(doc.getChartByTitle(areaTitle));
      Assert.assertEquals(1, doc.getChartCount());
      doc.save(ResourceUtilities.newTestOutputFile(CHART_FILE3));

    } catch (Exception e) {
      Logger.getLogger(DataSetTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
    }
View Full Code Here

      base = cell.getBorder(CellBordersType.DIAGONALTLBR);
      Assert.assertEquals(borderbase, base);
      Assert.assertEquals(StyleTypeDefinitions.LineType.SINGLE, borderbase.getLineStyle());
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("testSupportedLinearMeasure.ods"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      TableCellProperties styleCell = cell.getStyleHandler().getTableCellPropertiesForWrite();
      Border bor = styleCell.getBorder();
      Assert.assertEquals(borderbase, bor);
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("testSupportedLinearMeasure.ods"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      TableCellProperties styleCell = cell.getStyleHandler().getTableCellPropertiesForWrite();
      Border bor = styleCell.getRightBorder();
      Assert.assertEquals(borderbase, bor);
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("testSupportedLinearMeasure.ods"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      table2.setTableName("Sheet2");
      CellRange cellRange2 = table2.getCellRangeByPosition("A1", "F3");
      Cell cell2 = table2.getCellByPosition("A1");
      cell2.setStringValue("Merge A1:F3");
      cellRange2.merge();
      ods.save(ResourceUtilities.newTestOutputFile(filename + "MergeExpandCell.ods"));
      table = ods.getTableByName("Sheet1");
      Assert.assertTrue(table.getColumnCount() == 5);
      Assert.assertTrue(table.getRowCount() == 1);
      table = ods.getTableByName("Sheet2");
      Assert.assertTrue(table.getColumnCount() == 6);
View Full Code Here

          .setFont(font4Base, new Locale(Locale.ENGLISH.getLanguage(), Locale.US.getCountry()));
      cell7.setStringValue("SimSun BOLD 8 BLACK");
      Assert.assertEquals(font3Base, cell7.getStyleHandler().getFont(Document.ScriptType.CJK));
      Assert.assertEquals(font4Base, cell7.getStyleHandler().getFont(Document.ScriptType.WESTERN));

      doc.save(ResourceUtilities.newTestOutputFile("testFontOutput.ods"));

    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail();
    }
View Full Code Here

      Cell cell = table.getCellByPosition("A1");
      cell.setFont(font);
      cell.setStringValue("Hello world .");
     
      //save
      document.save(ResourceUtilities.newTestOutputFile("testFontOutput1.ods"));
     
      //validate
      SpreadsheetDocument doc = SpreadsheetDocument.loadDocument(ResourceUtilities
          .getTestResourceAsStream("testFontOutput1.ods"));
      Table table1 = doc.getTableByName("Sheet1");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.