@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1 = col.column("Column1", "field1", String.class); TextColumnBuilder<String> column2 = col.column("Column2", "field2", String.class); TextColumnBuilder<Integer> column3 = col.column("Column3", "field3", Integer.class); VariableBuilder<Integer> column2Variable = variable(column2, Calculation.DISTINCT_COUNT); column2Variable.setResetType(Evaluation.FIRST_GROUP); rb.columns(column1, column2, column3) .groupBy(column1) .summary( cht.barChart().setCategory(column1).series(cht.serie(exp.number(1)).setLabel("")), cht.barChart().setCategory(column1).series(cht.serie(column2Variable).setLabel(""))); }
protected void addExpression(VariableBuilder<?> variable) { Validate.notNull(variable, "variable must not be null"); this.expressions.add(variable.getVariable()); }
protected AbstractCategoryChartSerieBuilder( U categoryChartSerie, VariableBuilder<? extends Number> variable) { super(categoryChartSerie); Validate.notNull(variable, "variable must not be null"); getObject().setValueExpression(variable.build()); }