Package org.xlsx4j.sml

Examples of org.xlsx4j.sml.SheetData



      private static void addContent(WorksheetPart sheet) throws JAXBException, Docx4JException {

          // Minimal content already present
          SheetData sheetData = sheet.getContents().getSheetData();

          // Now add
          Row row = Context.getsmlObjectFactory().createRow();
          Cell cell = Context.getsmlObjectFactory().createCell();
          cell.setV("1234");
          row.getC().add(cell);


          row.getC().add(createCell("hello world!"));
          sheetData.getRow().add(row);
         
          // ADD A COMMENT TO CELL A1
          CommentsPart cp = new CommentsPart();
          cp.setContents(createComment("A1"));
          sheet.addTargetPart(cp);
View Full Code Here


    CTSheetFormatPr format = Context.getsmlObjectFactory().createCTSheetFormatPr();
    format.setDefaultRowHeight(5);
    format.setCustomHeight(Boolean.TRUE);
    sheet.getJaxbElement().setSheetFormatPr(format);
         
    SheetData sheetData = sheet.getJaxbElement().getSheetData();
               
    Row row = Context.getsmlObjectFactory().createRow();
         
    row.setHt(66.0);
    row.setCustomHeight(Boolean.TRUE);
    row.setR(1L);
         
    Cell cell1 = Context.getsmlObjectFactory().createCell();
    cell1.setV("1234");
    row.getC().add(cell1);
         
    Cell cell2 = Context.getsmlObjectFactory().createCell();
    cell2.setV("56");
    row.getC().add(cell2);
    sheetData.getRow().add(row);
               
    SaveToZipFile saver = new SaveToZipFile(pkg);
    saver.save( System.getProperty("user.dir") + "/sheet10.xlsx");
  }
View Full Code Here

    // Now lets print the cell content
    for(WorksheetPart sheet: worksheets) {
      System.out.println(sheet.getPartName().getName() );
      Worksheet ws = sheet.getJaxbElement();
      SheetData data = ws.getSheetData();
      for (Row r : data.getRow() ) {
        System.out.println("row " + r.getR() );       
        for (Cell c : r.getC() ) {
          if (c.getT().equals(STCellType.S)) {
            System.out.println( "  " + c.getR() + " contains " +
                sharedStrings.getJaxbElement().getSi().get(Integer.parseInt(c.getV())).getT()
View Full Code Here

  }
 
  private static void addContent(WorksheetPart sheet) {
   
    // Minimal content already present
    SheetData sheetData = sheet.getJaxbElement().getSheetData();
       
    // Now add
    Row row = Context.getsmlObjectFactory().createRow();
    Cell cell = Context.getsmlObjectFactory().createCell();
    cell.setV("1234");
    row.getC().add(cell);
   
   
    row.getC().add(createCell("hello world!"));
   
    sheetData.getRow().add(row);
  }
View Full Code Here

  }
 
  private static void addContent(WorksheetPart sheet) {
   
    // Minimal content already present
    SheetData sheetData = sheet.getJaxbElement().getSheetData();
       
    // Now add
    Row row = Context.getsmlObjectFactory().createRow();
    Cell cell = Context.getsmlObjectFactory().createCell();
    cell.setV("1234");
    row.getC().add(cell);
   
   
    row.getC().add(createCell("hello world!"));
   
    sheetData.getRow().add(row);
  }
View Full Code Here

 
 
  private static void addContent(WorksheetPart sheet) throws JAXBException, Docx4JException {
 
      // Minimal content already present
      SheetData sheetData = sheet.getContents().getSheetData();
 
      // Now add
      Row row = Context.getsmlObjectFactory().createRow();
      Cell cell = Context.getsmlObjectFactory().createCell();
      cell.setV("1234");
      row.getC().add(cell);
 
 
      row.getC().add(createCell("hello world!"));
      sheetData.getRow().add(row);
     
      // ADD A COMMENT TO CELL A1
      CommentsPart cp = new CommentsPart();
      cp.setContents(createComment("A1"));
      sheet.addTargetPart(cp);
View Full Code Here

    CTSheetFormatPr format = Context.getsmlObjectFactory().createCTSheetFormatPr();
    format.setDefaultRowHeight(5);
    format.setCustomHeight(Boolean.TRUE);
    sheet.getJaxbElement().setSheetFormatPr(format);
         
    SheetData sheetData = sheet.getJaxbElement().getSheetData();
               
    Row row = Context.getsmlObjectFactory().createRow();
         
    row.setHt(66.0);
    row.setCustomHeight(Boolean.TRUE);
    row.setR(1L);
         
    Cell cell1 = Context.getsmlObjectFactory().createCell();
    cell1.setV("1234");
    row.getC().add(cell1);
         
    Cell cell2 = Context.getsmlObjectFactory().createCell();
    cell2.setV("56");
    row.getC().add(cell2);
    sheetData.getRow().add(row);
               
    SaveToZipFile saver = new SaveToZipFile(pkg);
    saver.save( System.getProperty("user.dir") + "/data/xlsx4j/RowHeight-Xlsx4j.xlsx");
  }
View Full Code Here

TOP

Related Classes of org.xlsx4j.sml.SheetData

Copyright © 2018 www.massapicom. 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.