use of net.sf.jasperreports.engine.design.JRDesignField in project opennms by OpenNMS.
the class JRobinFieldsProvider method addStepField.
private void addStepField(List<JRField> fields) {
JRDesignField field = new JRDesignField();
field.setName("Step");
field.setDescription("Step");
field.setValueClass(Integer.class);
fields.add(field);
}
use of net.sf.jasperreports.engine.design.JRDesignField in project opennms by OpenNMS.
the class JRobinFieldsProvider method getFields.
public JRField[] getFields(IReportConnection irConn, JRDataset reportDataset, Map parameters) throws JRException, UnsupportedOperationException {
String query = "";
if (reportDataset.getQuery() == null || reportDataset.getQuery().getText() == null || reportDataset.getQuery().getText().length() == 0) {
return new JRField[0];
}
List<JRField> fields = new ArrayList<JRField>();
//Add timestamp field
addTimestampField(fields);
query = reportDataset.getQuery().getText();
if (query.contains("--step")) {
addStepField(fields);
}
Matcher matcher = m_pattern.matcher(query);
boolean matchFound = matcher.find();
int i = 0;
while (matchFound) {
JRDesignField field = new JRDesignField();
String fieldName = matcher.group();
if (fieldName.contains(":")) {
String[] split = fieldName.split(":");
fieldName = split[split.length - 1];
}
field.setName(fieldName);
field.setValueClass(Double.class);
field.setDescription(fieldName);
fields.add(field);
matchFound = matcher.find();
i++;
}
System.out.println("match count: " + matcher.groupCount());
return fields.toArray(new JRField[fields.size()]);
}
use of net.sf.jasperreports.engine.design.JRDesignField in project opennms by OpenNMS.
the class MeasurementDataSource method createField.
protected static JRField createField(String name, Class clazz) {
final JRDesignField field = new JRDesignField();
field.setValueClass(clazz);
field.setName(name);
return field;
}
use of net.sf.jasperreports.engine.design.JRDesignField in project opennms by OpenNMS.
the class JRobinFieldsProvider method addTimestampField.
private void addTimestampField(List<JRField> fields) {
JRDesignField field = new JRDesignField();
field.setName("Timestamp");
field.setDescription("Timestamp");
field.setValueClass(Date.class);
fields.add(field);
}
use of net.sf.jasperreports.engine.design.JRDesignField in project opennms by OpenNMS.
the class ResourceQueryFieldsProvider method addPathColumn.
private void addPathColumn(List<JRField> fields) {
JRDesignField field = new JRDesignField();
field.setName("Path");
field.setDescription("Path");
field.setValueClass(String.class);
fields.add(field);
}
Aggregations