use of com.ramussoft.report.Query in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method printReport.
private void printReport(final String string) throws IOException {
final long num = Long.parseLong(string);
Element report = null;
report = dataPlugin.getEngine().getElement(num);
if (report == null) {
printError(RES.getString("reportEror"));
return;
}
htmlTitle = report.getName();
printStartD();
Query query = null;
Qualifier qualifier = ((ReportQuery) dataPlugin.getEngine()).getHTMLReportQuery(report);
if (qualifier != null) {
query = new Query(null);
List<Element> elements = new ArrayList<Element>();
for (Row row : getSelRows(qualifier)) {
elements.add(row.getElement());
}
query.setElements(elements);
}
printReport(report, query);
printEndD();
}
use of com.ramussoft.report.Query in project ramus by Vitaliy-Yakovchuk.
the class QueryView method getQuery.
public Query getQuery() {
if (selectableTableView == null)
return null;
Query query = new Query(new HashMap<String, String>(0));
List<Row> rows = selectableTableView.getSelectedRows();
ArrayList<Element> elements = new ArrayList<Element>(rows.size());
for (Row row : rows) elements.add(row.getElement());
query.setElements(elements);
return query;
}
use of com.ramussoft.report.Query in project ramus by Vitaliy-Yakovchuk.
the class ReportEditorView method getHTMLText.
protected String getHTMLText() {
String page;
try {
HashMap<String, Object> map = new HashMap<String, Object>();
Query query = queryView.getQuery();
if (query != null)
map.put("query", query);
page = ((ReportQuery) framework.getEngine()).getHTMLReport(element, map);
} catch (Exception e1) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
PrintStream s = new PrintStream(stream);
e1.printStackTrace();
if (e1 instanceof DataException)
s.println(((DataException) e1).getMessage(new MessageFormatter() {
@Override
public String getString(String key, Object[] arguments) {
return MessageFormat.format(ReportResourceManager.getString(key), arguments);
}
}));
else {
e1.printStackTrace(s);
}
s.flush();
page = new String(stream.toByteArray());
}
return page;
}
Aggregations