JRDesignDataset jrDataset = new JRDesignDataset(false);
// jrDataset.setName("sub1");
for (int i = rows.length-1; i >= 0; i--) {
DJCrosstabRow crosstabRow = rows[i];
JRDesignField field = new JRDesignField();
field.setName(crosstabRow.getProperty().getProperty());
field.setValueClassName(crosstabRow.getProperty().getValueClassName());
try {
jrDataset.addField(field);
} catch (JRException e) {
log.error(e.getMessage(),e);
}
}
for (int i = cols.length-1; i >= 0; i--) {
DJCrosstabColumn crosstabColumn = cols[i];
JRDesignField field = new JRDesignField();
field.setName(crosstabColumn.getProperty().getProperty());
field.setValueClassName(crosstabColumn.getProperty().getValueClassName());
try {
jrDataset.addField(field);
} catch (JRException e) {
log.error(e.getMessage(),e);
}
}
for (Iterator iterator = djcrosstab.getMeasures().iterator(); iterator.hasNext();) {
JRDesignField field = new JRDesignField();
DJCrosstabMeasure djmeasure = (DJCrosstabMeasure) iterator.next();
field.setName(djmeasure.getProperty().getProperty());
field.setValueClassName(djmeasure.getProperty().getValueClassName());
try {
jrDataset.addField(field);
} catch (JRException e) {
log.error(e.getMessage(),e);
}