Search in sources :

Example 1 with EVScheduleRollup

use of net.sourceforge.processdash.ev.EVScheduleRollup in project processdash by dtuma.

the class EVReport method writeValueTable2.

public void writeValueTable2() {
    if (evModel != null) {
        EVSchedule s = evModel.getSchedule();
        int maxSeries = 3;
        if (s instanceof EVScheduleRollup)
            maxSeries = 4;
        writeChartData(s.getValueChartData(), maxSeries);
    } else
        writeFakeChartData("Plan", "Actual", "Forecast", "Optimized");
}
Also used : EVSchedule(net.sourceforge.processdash.ev.EVSchedule) EVScheduleRollup(net.sourceforge.processdash.ev.EVScheduleRollup)

Example 2 with EVScheduleRollup

use of net.sourceforge.processdash.ev.EVScheduleRollup in project processdash by dtuma.

the class EVReport method writeXls.

/** Generate a excel spreadsheet to display EV charts.
     */
public void writeXls() throws IOException {
    if (evModel == null || evModel.isEmpty()) {
        out.print("Status: 404 Not Found\r\n\r\n");
        out.flush();
    } else if (ExcelReport.hasPermission() == false) {
        writeHtmlHeader();
        ExcelReport.writeNoPermission(out);
    } else if ("Excel97".equalsIgnoreCase(Settings.getVal("excel.exportChartsMethod"))) {
        out.print("Content-type: application/vnd.ms-excel\r\n\r\n");
        out.flush();
        FileUtils.copyFile(EVReport.class.getResourceAsStream("evCharts97.xls"), outStream);
    } else {
        out = new PrintWriter(new OutputStreamWriter(outStream, "us-ascii"));
        out.print("Content-type: application/vnd.ms-excel\r\n\r\n");
        BufferedReader in = new BufferedReader(new InputStreamReader(EVReport.class.getResourceAsStream("evCharts2002.mht"), "us-ascii"));
        scanAndCopyLines(in, "Single File Web Page", true, false);
        out.print("This document, generated by the Process Dashboard,\r\n" + "is designed to work with Excel 2002 and higher.  If\r\n" + "you are using an earlier version of Excel, try\r\n" + "adding the following line to your pspdash.ini file:\r\n" + "excel.exportChartsMethod=Excel97\r\n");
        boolean needsOptimizedLine = (evModel.getSchedule() instanceof EVScheduleRollup);
        if (needsOptimizedLine == false) {
            // find the data series immediately preceeding the series
            // describing the optimized line.  Copy it all to output.
            scanAndCopyLines(in, "'EV Data'!$D$2:$D$10", true, true);
            scanAndCopyLines(in, "</x:Series>", true, true);
            // Now skip over and discard the series describing the
            // optimized line.
            scanAndCopyLines(in, "</x:Series>", false, false);
        }
        String line;
        while ((line = scanAndCopyLines(in, "http://localhost:2468/++/", true, false)) != null) {
            writeUrlLine(line);
        }
        out.flush();
    }
}
Also used : InputStreamReader(java.io.InputStreamReader) EVScheduleRollup(net.sourceforge.processdash.ev.EVScheduleRollup) BufferedReader(java.io.BufferedReader) OutputStreamWriter(java.io.OutputStreamWriter) PrintWriter(java.io.PrintWriter)

Aggregations

EVScheduleRollup (net.sourceforge.processdash.ev.EVScheduleRollup)2 BufferedReader (java.io.BufferedReader)1 InputStreamReader (java.io.InputStreamReader)1 OutputStreamWriter (java.io.OutputStreamWriter)1 PrintWriter (java.io.PrintWriter)1 EVSchedule (net.sourceforge.processdash.ev.EVSchedule)1