Package com.Ostermiller.util

Examples of com.Ostermiller.util.ExcelCSVPrinter


    workDialog.setVisible(true);
    workDialog.SetProgress(0);
    try {
      out = new FileOutputStream(outputFile);
      if (isExcel) {
        printer = new ExcelCSVPrinter(out);
      } else {
        printer = new CSVPrinter(out);
      }
      printer.changeDelimiter(delimiter);
      DataConnection dc = DataConnection.getInstance(view);
View Full Code Here


    }

    public ByteArrayOutputStream exportAsCSV() throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ExcelCSVPrinter ecsvp = new ExcelCSVPrinter(baos);
        ecsvp.changeDelimiter(';');
        ecsvp.setAlwaysQuote(true);
        //Generate the item row
        List<String> colLabels = getColLabels();
        ecsvp.write("");
        for (String colLabel : colLabels) {
            ecsvp.write(colLabel);
        }
        ecsvp.writeln();
        List<String> rowLabels = getRowLabels();

        String[][] matrix = getMatrixFormatted();
        for (int i = 0; i < rowLabels.size(); i++) {
            String rowLabel = rowLabels.get(i);
            ecsvp.write(rowLabel);
            for (int j = 0; j < matrix[i].length; j++) {
                ecsvp.write(matrix[i][j]);
            }
            ecsvp.writeln();
        }
        ecsvp.flush();
        ecsvp.close();
        return baos;

    }
View Full Code Here

        // Create the printer
        CSVPrint csvPrint = null;
        if("UNIX".equals(style)) {
          csvPrint = new CSVPrinter(new OutputStreamWriter(new FileOutputStream(csvFile), "UTF-8"), '#', quoteCharacter, seperator, false, true);
        } else if("EXCEL".equals(style)) {
          csvPrint = new ExcelCSVPrinter(new OutputStreamWriter(new FileOutputStream(csvFile), "UTF-8"), quoteCharacter, seperator, false, true);
        }
        nameCsvPrintMap.put(entry.getParameterMap().get(NAME), csvPrint);

        // If this flag is set add the first
        if (Boolean.valueOf(FilterUtils.getNullSafe(entry.getParameterMap().get(ADD_FIELD_NAMES_TO_FIRST_LINE), "false"))) {
View Full Code Here

TOP

Related Classes of com.Ostermiller.util.ExcelCSVPrinter

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.