Package org.projectforge.excel

Examples of org.projectforge.excel.ExportSheet.addRow()


  {
    final ExportSheet sheet = exporter.addSheet(sheetTitle);
    sheet.createFreezePane(0, 1);
    final ContentProvider sheetProvider = sheet.getContentProvider();

    sheet.addRow();
    sheet.setMergedRegion(0, 0, 1, 3, I18n.getString("plugins.liquidityplanning.entry.expectedDateOfPayment"));
    sheet.setMergedRegion(0, 0, 4, 6, I18n.getString("plugins.liquidityplanning.forecast.dueDate"));

    final ExportColumn[] cols = new ExportColumn[7];
    int colNo = 0;
View Full Code Here


    final int firstDataRowNumber = sheet.getRowCounter() + 1;
    final DayHolder current = today.clone();
    PropertyMapping mapping = new PropertyMapping();
    mapping.add("balanceExpected", BigDecimal.ZERO);
    mapping.add("balance", new Formula("D" + firstDataRowNumber));
    sheet.addRow(mapping.getMapping(), 0);

    for (int i = 0; i < credits.length; i++) {
      final int rowNumber = sheet.getRowCounter();
      mapping.add("date", current);
      mapping.add("creditsExpected", NumberHelper.isZeroOrNull(creditsExpected[i]) == true ? "" : creditsExpected[i]);
View Full Code Here

      mapping.add("debitsExpected", NumberHelper.isZeroOrNull(debitsExpected[i]) == true ? "" : debitsExpected[i]);
      mapping.add("balanceExpected", new Formula("D" + rowNumber + "+SUM(B" + rowNumber + ":C" + rowNumber + ")"));
      mapping.add("credits", NumberHelper.isZeroOrNull(credits[i]) == true ? "" : credits[i]);
      mapping.add("debits", NumberHelper.isZeroOrNull(debits[i]) == true ? "" : debits[i]);
      mapping.add("balance", new Formula("G" + rowNumber + "+SUM(E" + rowNumber + ":F" + rowNumber + ")"));
      sheet.addRow(mapping.getMapping(), 0);
      current.add(Calendar.DAY_OF_YEAR, 1);
    }
    mapping = new PropertyMapping();
    mapping.add("creditsExpected", new Formula("SUM(B" + firstDataRowNumber + ":B" + sheet.getRowCounter() + ")"));
    mapping.add("debitsExpected", new Formula("SUM(C" + firstDataRowNumber + ":C" + sheet.getRowCounter() + ")"));
View Full Code Here

      mapping.add(Col.FAKTURIERT, kost.getKost2Art().isFakturiert() ? "X" : "");
      mapping.add(Col.PROJEKT, KostFormatter.formatProjekt(kost.getProjekt()));
      mapping.add(Col.STATUS, kost.getKostentraegerStatus());
      mapping.add(Col.DESCRIPTION, kost.getDescription());
      mapping.add(Col.COMMENT, kost.getComment());
      sheet.addRow(mapping.getMapping(), 0);
    }
    sheet.setZoom(3, 4); // 75%
    DownloadUtils.setDownloadTarget(xls.getAsByteArray(), filename);
  }
View Full Code Here

    // create a default Date format and currency column
    xls.setContentProvider(contentProvider);

    final String sheetTitle = getSheetTitle();
    final ExportSheet sheet = xls.addSheet(sheetTitle);
    sheet.addRow(); // Column headers
    sheet.setMergedRegion(0, 0, Col.MAILING_ADDRESS.ordinal(), Col.MAILING_STATE.ordinal(), "Mailing");
    sheet.setMergedRegion(0, 0, Col.ADDRESS.ordinal(), Col.STATE.ordinal(), PFUserContext.getLocalizedString("address.addressText"));
    sheet.setMergedRegion(0, 0, Col.POSTAL_ADDRESS.ordinal(), Col.POSTAL_STATE.ordinal(), PFUserContext
        .getLocalizedString("address.postalAddressText"));
    sheet.setMergedRegion(0, 0, Col.PRIVATE_ADDRESS.ordinal(), Col.PRIVATE_STATE.ordinal(), PFUserContext
View Full Code Here

    sheet.setColumns(columns);

    final PropertyMapping mapping = new PropertyMapping();
    for (final AddressDO address : list) {
      addAddressMapping(mapping, address, params);
      sheet.addRow(mapping.getMapping(), 0);
    }
    sheet.setZoom(3, 4); // 75%
    return xls.getAsByteArray();
  }
View Full Code Here

        final ExportSheet sheet = workbook.addSheet("Update history");
        sheet.getContentProvider().setColWidths(new int[] { 20, 10, 20, 15, 50, 20});
        sheet.getContentProvider().putFormat(java.sql.Timestamp.class, "YYYY-MM-DD hh:mm:ss");
        sheet.setPropertyNames(new String[] { "regionId", "versionString", "updateDate", "executedBy.username", "description",
        "executionResult"});
        sheet.addRow().setValues("region id", "version", "update date", "executed by", "description", "execution result");
        sheet.addRows(updateEntries);
        final String filename = "ProjectForge-UpdateHistory_" + DateHelper.getDateAsFilenameSuffix(new Date()) + ".xls";
        final byte[] xls = workbook.getAsByteArray();
        DownloadUtils.setDownloadTarget(xls, filename);
      };
View Full Code Here

        }
      }.setDefaultExportContext(new MyXlsExportContext()));
      final ExportWorkbook workbook = new ExportWorkbook();
      final ExportSheet sheet = workbook.addSheet("Test");
      sheet.getContentProvider().setColWidths(20, 20, 20);
      sheet.addRow().setValues("Type", "Precision", "result");
      sheet.addRow().setValues("Java output", ".", "Tue Sep 28 00:27:10 UTC 2010");
      sheet.addRow().setValues("DateHolder", "DAY", getDateHolder().setPrecision(DatePrecision.DAY));
      sheet.addRow().setValues("DateHolder", "HOUR_OF_DAY", getDateHolder().setPrecision(DatePrecision.HOUR_OF_DAY));
      sheet.addRow().setValues("DateHolder", "MINUTE_15", getDateHolder().setPrecision(DatePrecision.MINUTE_15));
      sheet.addRow().setValues("DateHolder", "MINUTE", getDateHolder().setPrecision(DatePrecision.MINUTE));
View Full Code Here

      }.setDefaultExportContext(new MyXlsExportContext()));
      final ExportWorkbook workbook = new ExportWorkbook();
      final ExportSheet sheet = workbook.addSheet("Test");
      sheet.getContentProvider().setColWidths(20, 20, 20);
      sheet.addRow().setValues("Type", "Precision", "result");
      sheet.addRow().setValues("Java output", ".", "Tue Sep 28 00:27:10 UTC 2010");
      sheet.addRow().setValues("DateHolder", "DAY", getDateHolder().setPrecision(DatePrecision.DAY));
      sheet.addRow().setValues("DateHolder", "HOUR_OF_DAY", getDateHolder().setPrecision(DatePrecision.HOUR_OF_DAY));
      sheet.addRow().setValues("DateHolder", "MINUTE_15", getDateHolder().setPrecision(DatePrecision.MINUTE_15));
      sheet.addRow().setValues("DateHolder", "MINUTE", getDateHolder().setPrecision(DatePrecision.MINUTE));
      sheet.addRow().setValues("DateHolder", "SECOND", getDateHolder().setPrecision(DatePrecision.SECOND));
View Full Code Here

      final ExportWorkbook workbook = new ExportWorkbook();
      final ExportSheet sheet = workbook.addSheet("Test");
      sheet.getContentProvider().setColWidths(20, 20, 20);
      sheet.addRow().setValues("Type", "Precision", "result");
      sheet.addRow().setValues("Java output", ".", "Tue Sep 28 00:27:10 UTC 2010");
      sheet.addRow().setValues("DateHolder", "DAY", getDateHolder().setPrecision(DatePrecision.DAY));
      sheet.addRow().setValues("DateHolder", "HOUR_OF_DAY", getDateHolder().setPrecision(DatePrecision.HOUR_OF_DAY));
      sheet.addRow().setValues("DateHolder", "MINUTE_15", getDateHolder().setPrecision(DatePrecision.MINUTE_15));
      sheet.addRow().setValues("DateHolder", "MINUTE", getDateHolder().setPrecision(DatePrecision.MINUTE));
      sheet.addRow().setValues("DateHolder", "SECOND", getDateHolder().setPrecision(DatePrecision.SECOND));
      sheet.addRow().setValues("DateHolder", "MILLISECOND", getDateHolder().setPrecision(DatePrecision.MILLISECOND));
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.