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");
}
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();
}
}
Aggregations