*/
private void registerMeasures() {
for (Iterator iterator = djcross.getMeasures().iterator(); iterator.hasNext();) {
DJCrosstabMeasure djmeasure = (DJCrosstabMeasure) iterator.next();
JRDesignCrosstabMeasure measure = new JRDesignCrosstabMeasure();
measure.setName(djmeasure.getProperty().getProperty());
measure.setCalculation(djmeasure.getOperation().getValue());
measure.setValueClassName(djmeasure.getProperty().getValueClassName());
JRDesignExpression valueExp = new JRDesignExpression();
valueExp.setValueClassName(djmeasure.getProperty().getValueClassName());
valueExp.setText("$F{"+djmeasure.getProperty().getProperty()+"}");
measure.setValueExpression(valueExp);
if (djmeasure.getValueFormatter() != null){
JRDesignParameter dparam = new JRDesignParameter();
dparam.setName("crosstab-measure__" + measure.getName() + "_vf"); //value formater suffix
dparam.setValueClassName(DJValueFormatter.class.getName());
JRDesignCrosstabParameter crosstabParameter = new JRDesignCrosstabParameter();
crosstabParameter.setName("crosstab-measure__" + measure.getName() + "_vf"); //value formater suffix
crosstabParameter.setValueClassName(DJValueFormatter.class.getName());
log.debug("Registering value formatter parameter for property " + dparam.getName() );
try {
design.addParameter(dparam);
jrcross.addParameter(crosstabParameter);
} catch (JRException e) {
throw new EntitiesRegistrationException(e.getMessage(),e);
}
((DynamicJasperDesign)design).getParametersWithValues().put(dparam.getName(), djmeasure.getValueFormatter());
}
if (djmeasure.getPrecalculatedTotalProvider() != null){
JRDesignParameter dparam = new JRDesignParameter();
dparam.setName("crosstab-measure__" + measure.getName() + "_totalProvider"); //value formater suffix
dparam.setValueClassName(DJCRosstabMeasurePrecalculatedTotalProvider.class.getName());
JRDesignCrosstabParameter crosstabParameter = new JRDesignCrosstabParameter();
crosstabParameter.setName("crosstab-measure__" + measure.getName() + "_totalProvider"); //value formater suffix
crosstabParameter.setValueClassName(DJCRosstabMeasurePrecalculatedTotalProvider.class.getName());
log.debug("Registering crosstab total provider parameter for property " + dparam.getName() );
try {
design.addParameter(dparam);