Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFSheet.createRow()


            + " limit 0, " + Constants.MAX_ROWS;
        try {
            ps = conn.prepareStatement(sql);
            rs = ps.executeQuery();
            while (rs.next()) {
                row = sheet.createRow(row.getRowNum() + 1);
                for (int i = 0; i < columnInfos.length; i++) {
                    ColumnInfo info = columnInfos[i];
                    HSSFCell cell = row.createCell(i);
                    cell.setCellStyle(commonStyle);
                    switch (info.getDataType()) {
View Full Code Here


   
   
     for (String s : loggedItems){
           
            // Create a row and put some cells in it. Rows are 0 based.
            HSSFRow row = sheet.createRow(currentRow);
           
            // Create a cell and put a value in it.
            HSSFCell cell = row.createCell((short)0);
            cell.setCellValue(s);
View Full Code Here

    public void performExport(DataExportModel model, DataExportInstructions instructions, ConnectionHandler connectionHandler) throws DataExportException {
        HSSFWorkbook workbook = new HSSFWorkbook();
        HSSFSheet sheet = workbook.createSheet(model.getTableName());

        if (instructions.createHeader()) {
            HSSFRow headerRow = sheet.createRow(0);

            for (int columnIndex = 0; columnIndex < model.getColumnCount(); columnIndex++){
                String columnName = model.getColumnName(columnIndex);

                HSSFCell cell = headerRow.createCell(columnIndex);
View Full Code Here

        }

        CellStyleCache cellStyleCache = new CellStyleCache(workbook, model.getProject());

        for (short rowIndex = 0; rowIndex < model.getRowCount(); rowIndex++) {
            HSSFRow row = sheet.createRow(rowIndex + 1);
            for (int columnIndex = 0; columnIndex < model.getColumnCount(); columnIndex++){
                HSSFCell cell = row.createCell(columnIndex);
                Object value = model.getValue(rowIndex, columnIndex);
                if (value != null) {
                    if (value instanceof Number) {
View Full Code Here

      String transportFirm = getTransportFirmInfo(transport);
      dateString = getDateString(dateString, transport);

      // Overskrift
      row = sheet.createRow((short) currentRow++);

      createCell(row, cellStyle.getStyle12(), (short) 0, transport
          .getTransportName()
          + " - lasting: " + dateString);
View Full Code Here

      createCell(row, cellStyle.getStyle12(), (short) 0, transport
          .getTransportName()
          + " - lasting: " + dateString);

      row = sheet.createRow((short) currentRow++);
      createCell(row, cellStyle.getStyle12(), (short) 0, "firma:"
          + transportFirm);

      String comment = transport.getTransportComment();
      if (comment != null && comment.length() > 0) {
View Full Code Here

      createCell(row, cellStyle.getStyle12(), (short) 0, "firma:"
          + transportFirm);

      String comment = transport.getTransportComment();
      if (comment != null && comment.length() > 0) {
        row = sheet.createRow((short) currentRow++);
        createCell(row, cellStyle.getStyle12(), (short) 0, "kommentar:"
            + comment);
      }

      row = sheet.createRow((short) currentRow++);
View Full Code Here

        row = sheet.createRow((short) currentRow++);
        createCell(row, cellStyle.getStyle12(), (short) 0, "kommentar:"
            + comment);
      }

      row = sheet.createRow((short) currentRow++);

      int columnCount = tableModel.getColumnCount();
      int rowCount = tableModel.getRowCount();

      createColumnHeadings(row, cellStyle.getStyle12BorderBottomThick(),
View Full Code Here

      // Data
      int j;
      int k;
      for (j = currentRow; j < rowCount + currentRow; j++) {
        setLabelInfo(labelInfo, infoString, j);
        row = sheet.createRow((short) j);

        for (k = 0; k < columnCount; k++) {
          // kommentar
          if (k == 11) {
            // har kommentar
View Full Code Here

          // kommentar
          if (k == 11) {
            // har kommentar
            if (tableModel.getValueAt(j - currentRow, k) != null) {
              // lager egen linje for kommentar
              row = sheet.createRow((short) j + 1);
              createCell(row, null, (short) 0, String
                  .valueOf(tableModel.getValueAt(j
                      - currentRow++, k)));

              j++;
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.