this.formats = new ObjectsByColumn<Format>();
if (outputElement.getQueryRef() != null) {
query = report.getQueries().get(outputElement.getQueryRef());
if (query == null)
throw new BadReportSyntaxException("No query " + outputElement.getQueryRef() + " found.");
} else if (outputElement.getQuery() != null) {
PreparedQueryElement queryElement = outputElement.getQuery();
if (report.getQueries().get(queryElement.getName()) != null)
throw new BadReportSyntaxException("Query named " + queryElement.getName() + " already present in report");
query = new PreparedQuery(queryElement,report,outputElement);
// add query to report:
report.getQueries().put(queryElement.getName(),query);
} else {
GeneratedQueryElement queryElement = outputElement.getGeneratedQuery();
if (report.getQueries().get(queryElement.getName()) != null)
throw new BadReportSyntaxException("Query named " + queryElement.getName() + " already present in report");
query = new GeneratedQuery(queryElement,outputElement);
// add query to report:
report.getQueries().put(queryElement.getName(),query);
}
updatePostProcessClass();
chart = outputElement.getChart() == null ? Chart.TABLE : outputElement.getChart().getType();
int i = 1;
// formats:
try {
for (FormatElement formatElement : outputElement.getFormat()) {
Format format = new Format(formatElement.getValue());
formats.addByColName(format,formatElement.getColumn());
}
} catch (Exception e) {
log.error("exception adding formats",e);
throw new BadReportSyntaxException("Exception adding formats");
}
//drilldowns:
drillDowns = new ObjectsByColumn<DrillDownElement>();
for (DrillDownElement drillDownElement : outputElement.getDrillDown()) {