public class DefaultAdhocReportCustomizer extends Object implements AdhocReportCustomizer
DefaultAdhocReportCustomizer class.
Provides basic implementation for theAdhocReportCustomizer.customize(ReportBuilder, AdhocReport) method. The public methods can be extended to provide further customization at runtime as
shown;
class ReportCustomizer extends DefaultAdhocReportCustomizer {
//@Override
public void customize(ReportBuilder<?> report, AdhocReport adhocReport) throws DRException {
super.customize(report, adhocReport);
// default report values
report.setTemplate(Templates.reportTemplate);
report.title(Templates.createTitleComponent("AdhocCustomizer"));
// a fixed page footer that user cannot change, this customization is not stored in the xml file
report.pageFooter(Templates.footerComponent);
}
//@Override
protected DRIDataType<?, ?> getFieldType(String name) {
if (name.equals("item")) {
return type.stringType();
}
if (name.equals("orderdate")) {
return type.dateType();
}
if (name.equals("quantity")) {
return type.integerType();
}
if (name.equals("unitprice")) {
return type.bigDecimalType();
}
return super.getFieldType(name);
}
//@Override
protected String getFieldLabel(String name) {
if (name.equals("item")) {
return "Item";
}
if (name.equals("orderdate")) {
return "Order date";
}
if (name.equals("quantity")) {
return "Quantity";
}
if (name.equals("unitprice")) {
return "Unit price";
}
return name;
}
}
| Modifier and Type | Field and Description |
|---|---|
protected AdhocReport |
adhocReport |
protected Map<String,ColumnBuilder<?,?>> |
columns |
protected Map<String,ComponentBuilder<?,?>> |
components |
protected Map<String,GroupBuilder<?>> |
groups |
protected ReportBuilder<?> |
report |
| Constructor and Description |
|---|
DefaultAdhocReportCustomizer() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addComponents()
addComponents.
|
protected void |
addSubtotal(SubtotalBuilder<?,?> subtotal,
AdhocSubtotalPosition adhocSubtotalPosition,
String groupName)
addSubtotal.
|
protected void |
addSubtotals()
addSubtotals.
|
protected AreaChartBuilder |
areaChart(AdhocChart adhocChart)
areaChart.
|
protected AxisFormatBuilder |
axisFormat(AdhocAxisFormat adhocAxisFormat)
axisFormat.
|
protected Bar3DChartBuilder |
bar3DChart(AdhocChart adhocChart)
bar3DChart.
|
protected BarChartBuilder |
barChart(AdhocChart adhocChart)
barChart.
|
protected void |
baseChart(AdhocChart adhocChart,
AbstractBaseChartBuilder<?,?,?> baseChart)
baseChart.
|
protected BaseStyleBuilder<?,?> |
baseStyle(AdhocStyle adhocStyle,
BaseStyleBuilder<?,?> baseStyle)
baseStyle.
|
protected BubbleChartBuilder |
bubbleChart(AdhocChart adhocChart)
bubbleChart.
|
protected void |
bubbleChart(AdhocChart adhocChart,
BubbleChartBuilder bubbleChart)
bubbleChart.
|
protected Calculation |
calculation(AdhocCalculation adhocCalculation)
calculation.
|
protected void |
categoryChart(AdhocChart adhocChart,
AbstractCategoryChartBuilder<?,?> categoryChart)
categoryChart.
|
protected CategoryChartSerieBuilder |
categoryChartSerie(AdhocChartSerie adhocChartSerie)
categoryChartSerie.
|
protected AbstractChartBuilder<?> |
chart(AdhocChart adhocChart)
chart.
|
protected void |
chart(AdhocChart adhocChart,
AbstractChartBuilder<?> chart)
chart.
|
protected void |
chartSerie(AdhocChartSerie adhocChartSerie,
AbstractChartSerieBuilder<?,?> chartSerie)
chartSerie.
|
protected ColumnBuilder<?,?> |
column(AdhocColumn adhocColumn)
column.
|
protected ComponentBuilder<?,?> |
component(AdhocComponent adhocComponent)
component.
|
protected void |
component(AdhocComponent adhocComponent,
ComponentBuilder<?,?> component)
component.
|
void |
customize(ReportBuilder<?> report,
AdhocReport adhocReport)
customize.
|
protected DifferenceChartBuilder |
differenceChart(AdhocChart adhocChart)
differenceChart.
|
protected FontBuilder |
font(AdhocFont adhocFont)
font.
|
protected DRIExpression<?> |
getFieldExpression(String name)
getFieldExpression.
|
protected String |
getFieldLabel(String name)
getFieldLabel.
|
protected DRIDataType<?,?> |
getFieldType(String name)
getFieldType.
|
protected GroupBuilder<?> |
group(AdhocGroup adhocGroup)
group.
|
protected GroupedCategoryChartSerieBuilder |
groupedCategoryChartSerie(AdhocChartSerie adhocChartSerie)
groupedCategoryChartSerie.
|
protected GroupedStackedBarChartBuilder |
groupedStackedBarChart(AdhocChart adhocChart)
groupedStackedBarChart.
|
protected GroupHeaderLayout |
groupHeaderLayout(AdhocGroupHeaderLayout groupHeaderLayout)
groupHeaderLayout.
|
protected HorizontalTextAlignment |
horizontalTextAlignment(AdhocHorizontalAlignment adhocHorizontalAlignment)
horizontalTextAlignment.
|
protected LayeredBarChartBuilder |
layeredBarChart(AdhocChart adhocChart)
layeredBarChart.
|
protected LineChartBuilder |
lineChart(AdhocChart adhocChart)
lineChart.
|
protected OrderType |
orderType(AdhocOrderType adhocOrderType)
orderType.
|
protected Orientation |
orientation(AdhocOrientation adhocOrientation)
orientation.
|
protected void |
page(ReportBuilder<?> report,
AdhocPage adhocPage)
page.
|
protected PageOrientation |
pageOrientation(AdhocPageOrientation adhocPageOrientation)
pageOrientation.
|
protected PenBuilder |
pen(AdhocPen adhocPen)
pen.
|
protected Pie3DChartBuilder |
pie3DChart(AdhocChart adhocChart)
pie3DChart.
|
protected PieChartBuilder |
pieChart(AdhocChart adhocChart)
pieChart.
|
protected void |
pieChart(AdhocChart adhocChart,
AbstractPieChartBuilder<?,?> pieChart)
pieChart.
|
protected ScatterChartBuilder |
scatterChart(AdhocChart adhocChart)
scatterChart.
|
protected SimpleStyleBuilder |
simpleStyle(AdhocStyle adhocStyle)
simpleStyle.
|
protected SortBuilder |
sort(AdhocSort adhocSort)
sort.
|
protected SpiderChartBuilder |
spiderChart(AdhocChart adhocChart)
spiderChart.
|
protected void |
spiderChart(AdhocChart adhocChart,
SpiderChartBuilder spiderChart)
spiderChart.
|
protected StackedAreaChartBuilder |
stackedAreaChart(AdhocChart adhocChart)
stackedAreaChart.
|
protected StackedBar3DChartBuilder |
stackedBar3DChart(AdhocChart adhocChart)
stackedBar3DChart.
|
protected StackedBarChartBuilder |
stackedBarChart(AdhocChart adhocChart)
stackedBarChart.
|
protected StyleBuilder |
style(AdhocStyle adhocStyle)
style.
|
protected SubtotalBuilder<?,?> |
subtotal(AdhocSubtotal adhocSubtotal)
subtotal.
|
protected SubtotalBuilder<?,?>[] |
subtotals()
subtotals.
|
protected TextFieldBuilder<?> |
textField(AdhocTextField adhocTextField)
textField.
|
protected TimePeriod |
timePeriodType(AdhocTimePeriod timePeriod)
timePeriodType.
|
protected TimeSeriesChartBuilder |
timeSeriesChart(AdhocChart adhocChart)
timeSeriesChart.
|
protected void |
timeSeriesChart(AdhocChart adhocChart,
AbstractTimeSeriesChartBuilder<?,?> timeSeriesChart)
timeSeriesChart.
|
protected VerticalTextAlignment |
verticalTextAlignment(AdhocVerticalAlignment adhocVerticalAlignment)
verticalTextAlignment.
|
protected WaterfallBarChartBuilder |
waterfallBarChart(AdhocChart adhocChart)
waterfallBarChart.
|
protected XyAreaChartBuilder |
xyAreaChart(AdhocChart adhocChart)
xyAreaChart.
|
protected XyBarChartBuilder |
xyBarChart(AdhocChart adhocChart)
xyBarChart.
|
protected void |
xyChart(AdhocChart adhocChart,
AbstractXyChartBuilder<?,?> xyChart)
xyChart.
|
protected XyChartSerieBuilder |
xyChartSerie(AdhocChartSerie adhocChartSerie)
xyChartSerie.
|
protected XyLineChartBuilder |
xyLineChart(AdhocChart adhocChart)
xyLineChart.
|
protected XyStepChartBuilder |
xyStepChart(AdhocChart adhocChart)
xyStepChart.
|
protected XyzChartSerieBuilder |
xyzChartSerie(AdhocChartSerie adhocChartSerie)
xyzChartSerie.
|
protected ReportBuilder<?> report
protected AdhocReport adhocReport
protected Map<String,ColumnBuilder<?,?>> columns
protected Map<String,GroupBuilder<?>> groups
protected Map<String,ComponentBuilder<?,?>> components
public void customize(ReportBuilder<?> report, AdhocReport adhocReport) throws DRException
customize.
customize in interface AdhocReportCustomizerreport - a ReportBuilder object.adhocReport - a AdhocReport object.DRException - if any.protected DRIDataType<?,?> getFieldType(String name)
getFieldType.
name - a String object.DRIDataType object.protected DRIExpression<?> getFieldExpression(String name)
getFieldExpression.
name - a String object.DRIExpression object.protected ColumnBuilder<?,?> column(AdhocColumn adhocColumn)
column.
adhocColumn - a AdhocColumn object.ColumnBuilder object.protected GroupBuilder<?> group(AdhocGroup adhocGroup)
group.
adhocGroup - a AdhocGroup object.GroupBuilder object.protected GroupHeaderLayout groupHeaderLayout(AdhocGroupHeaderLayout groupHeaderLayout)
groupHeaderLayout.
groupHeaderLayout - a AdhocGroupHeaderLayout object.GroupHeaderLayout object.protected void addSubtotals()
addSubtotals.
protected SubtotalBuilder<?,?>[] subtotals()
subtotals.
SubtotalBuilder objects.protected SubtotalBuilder<?,?> subtotal(AdhocSubtotal adhocSubtotal)
subtotal.
adhocSubtotal - a AdhocSubtotal object.SubtotalBuilder object.protected Calculation calculation(AdhocCalculation adhocCalculation)
calculation.
adhocCalculation - a AdhocCalculation object.Calculation object.protected void addSubtotal(SubtotalBuilder<?,?> subtotal, AdhocSubtotalPosition adhocSubtotalPosition, String groupName)
addSubtotal.
subtotal - a SubtotalBuilder object.adhocSubtotalPosition - a AdhocSubtotalPosition object.groupName - a String object.protected SortBuilder sort(AdhocSort adhocSort)
sort.
adhocSort - a AdhocSort object.SortBuilder object.protected OrderType orderType(AdhocOrderType adhocOrderType)
orderType.
adhocOrderType - a AdhocOrderType object.OrderType object.protected BaseStyleBuilder<?,?> baseStyle(AdhocStyle adhocStyle, BaseStyleBuilder<?,?> baseStyle)
baseStyle.
adhocStyle - a AdhocStyle object.baseStyle - a BaseStyleBuilder object.BaseStyleBuilder object.protected StyleBuilder style(AdhocStyle adhocStyle)
style.
adhocStyle - a AdhocStyle object.StyleBuilder object.protected SimpleStyleBuilder simpleStyle(AdhocStyle adhocStyle)
simpleStyle.
adhocStyle - a AdhocStyle object.SimpleStyleBuilder object.protected FontBuilder font(AdhocFont adhocFont)
font.
adhocFont - a AdhocFont object.FontBuilder object.protected PenBuilder pen(AdhocPen adhocPen)
pen.
adhocPen - a AdhocPen object.PenBuilder object.protected HorizontalTextAlignment horizontalTextAlignment(AdhocHorizontalAlignment adhocHorizontalAlignment)
horizontalTextAlignment.
adhocHorizontalAlignment - a AdhocHorizontalAlignment object.HorizontalTextAlignment object.protected VerticalTextAlignment verticalTextAlignment(AdhocVerticalAlignment adhocVerticalAlignment)
verticalTextAlignment.
adhocVerticalAlignment - a AdhocVerticalAlignment object.VerticalTextAlignment object.protected void page(ReportBuilder<?> report, AdhocPage adhocPage)
page.
report - a ReportBuilder object.adhocPage - a AdhocPage object.protected PageOrientation pageOrientation(AdhocPageOrientation adhocPageOrientation)
pageOrientation.
adhocPageOrientation - a AdhocPageOrientation object.PageOrientation object.protected void addComponents()
addComponents.
protected ComponentBuilder<?,?> component(AdhocComponent adhocComponent)
component.
adhocComponent - a AdhocComponent object.ComponentBuilder object.protected void component(AdhocComponent adhocComponent, ComponentBuilder<?,?> component)
component.
adhocComponent - a AdhocComponent object.component - a ComponentBuilder object.protected TextFieldBuilder<?> textField(AdhocTextField adhocTextField)
textField.
adhocTextField - a AdhocTextField object.TextFieldBuilder object.protected AbstractChartBuilder<?> chart(AdhocChart adhocChart)
chart.
adhocChart - a AdhocChart object.AbstractChartBuilder object.protected void chart(AdhocChart adhocChart, AbstractChartBuilder<?> chart)
chart.
adhocChart - a AdhocChart object.chart - a AbstractChartBuilder object.protected void baseChart(AdhocChart adhocChart, AbstractBaseChartBuilder<?,?,?> baseChart)
baseChart.
adhocChart - a AdhocChart object.baseChart - a AbstractBaseChartBuilder object.protected void categoryChart(AdhocChart adhocChart, AbstractCategoryChartBuilder<?,?> categoryChart)
categoryChart.
adhocChart - a AdhocChart object.categoryChart - a AbstractCategoryChartBuilder object.protected void timeSeriesChart(AdhocChart adhocChart, AbstractTimeSeriesChartBuilder<?,?> timeSeriesChart)
timeSeriesChart.
adhocChart - a AdhocChart object.timeSeriesChart - a AbstractTimeSeriesChartBuilder object.protected TimePeriod timePeriodType(AdhocTimePeriod timePeriod)
timePeriodType.
timePeriod - a AdhocTimePeriod object.TimePeriod object.protected void pieChart(AdhocChart adhocChart, AbstractPieChartBuilder<?,?> pieChart)
pieChart.
adhocChart - a AdhocChart object.pieChart - a AbstractPieChartBuilder object.protected void xyChart(AdhocChart adhocChart, AbstractXyChartBuilder<?,?> xyChart)
xyChart.
adhocChart - a AdhocChart object.xyChart - a AbstractXyChartBuilder object.protected void spiderChart(AdhocChart adhocChart, SpiderChartBuilder spiderChart)
spiderChart.
adhocChart - a AdhocChart object.spiderChart - a SpiderChartBuilder object.protected void bubbleChart(AdhocChart adhocChart, BubbleChartBuilder bubbleChart)
bubbleChart.
adhocChart - a AdhocChart object.bubbleChart - a BubbleChartBuilder object.protected AreaChartBuilder areaChart(AdhocChart adhocChart)
areaChart.
adhocChart - a AdhocChart object.AreaChartBuilder object.protected StackedAreaChartBuilder stackedAreaChart(AdhocChart adhocChart)
stackedAreaChart.
adhocChart - a AdhocChart object.StackedAreaChartBuilder object.protected BarChartBuilder barChart(AdhocChart adhocChart)
barChart.
adhocChart - a AdhocChart object.BarChartBuilder object.protected StackedBarChartBuilder stackedBarChart(AdhocChart adhocChart)
stackedBarChart.
adhocChart - a AdhocChart object.StackedBarChartBuilder object.protected GroupedStackedBarChartBuilder groupedStackedBarChart(AdhocChart adhocChart)
groupedStackedBarChart.
adhocChart - a AdhocChart object.GroupedStackedBarChartBuilder object.protected Bar3DChartBuilder bar3DChart(AdhocChart adhocChart)
bar3DChart.
adhocChart - a AdhocChart object.Bar3DChartBuilder object.protected StackedBar3DChartBuilder stackedBar3DChart(AdhocChart adhocChart)
stackedBar3DChart.
adhocChart - a AdhocChart object.StackedBar3DChartBuilder object.protected LineChartBuilder lineChart(AdhocChart adhocChart)
lineChart.
adhocChart - a AdhocChart object.LineChartBuilder object.protected LayeredBarChartBuilder layeredBarChart(AdhocChart adhocChart)
layeredBarChart.
adhocChart - a AdhocChart object.LayeredBarChartBuilder object.protected WaterfallBarChartBuilder waterfallBarChart(AdhocChart adhocChart)
waterfallBarChart.
adhocChart - a AdhocChart object.WaterfallBarChartBuilder object.protected DifferenceChartBuilder differenceChart(AdhocChart adhocChart)
differenceChart.
adhocChart - a AdhocChart object.DifferenceChartBuilder object.protected PieChartBuilder pieChart(AdhocChart adhocChart)
pieChart.
adhocChart - a AdhocChart object.PieChartBuilder object.protected Pie3DChartBuilder pie3DChart(AdhocChart adhocChart)
pie3DChart.
adhocChart - a AdhocChart object.Pie3DChartBuilder object.protected ScatterChartBuilder scatterChart(AdhocChart adhocChart)
scatterChart.
adhocChart - a AdhocChart object.ScatterChartBuilder object.protected SpiderChartBuilder spiderChart(AdhocChart adhocChart)
spiderChart.
adhocChart - a AdhocChart object.SpiderChartBuilder object.protected TimeSeriesChartBuilder timeSeriesChart(AdhocChart adhocChart)
timeSeriesChart.
adhocChart - a AdhocChart object.TimeSeriesChartBuilder object.protected XyAreaChartBuilder xyAreaChart(AdhocChart adhocChart)
xyAreaChart.
adhocChart - a AdhocChart object.XyAreaChartBuilder object.protected XyBarChartBuilder xyBarChart(AdhocChart adhocChart)
xyBarChart.
adhocChart - a AdhocChart object.XyBarChartBuilder object.protected XyLineChartBuilder xyLineChart(AdhocChart adhocChart)
xyLineChart.
adhocChart - a AdhocChart object.XyLineChartBuilder object.protected XyStepChartBuilder xyStepChart(AdhocChart adhocChart)
xyStepChart.
adhocChart - a AdhocChart object.XyStepChartBuilder object.protected BubbleChartBuilder bubbleChart(AdhocChart adhocChart)
bubbleChart.
adhocChart - a AdhocChart object.BubbleChartBuilder object.protected Orientation orientation(AdhocOrientation adhocOrientation)
orientation.
adhocOrientation - a AdhocOrientation object.Orientation object.protected AxisFormatBuilder axisFormat(AdhocAxisFormat adhocAxisFormat)
axisFormat.
adhocAxisFormat - a AdhocAxisFormat object.AxisFormatBuilder object.protected void chartSerie(AdhocChartSerie adhocChartSerie, AbstractChartSerieBuilder<?,?> chartSerie)
chartSerie.
adhocChartSerie - a AdhocChartSerie object.chartSerie - a AbstractChartSerieBuilder object.protected CategoryChartSerieBuilder categoryChartSerie(AdhocChartSerie adhocChartSerie)
categoryChartSerie.
adhocChartSerie - a AdhocChartSerie object.CategoryChartSerieBuilder object.protected GroupedCategoryChartSerieBuilder groupedCategoryChartSerie(AdhocChartSerie adhocChartSerie)
groupedCategoryChartSerie.
adhocChartSerie - a AdhocChartSerie object.GroupedCategoryChartSerieBuilder object.protected XyChartSerieBuilder xyChartSerie(AdhocChartSerie adhocChartSerie)
xyChartSerie.
adhocChartSerie - a AdhocChartSerie object.XyChartSerieBuilder object.protected XyzChartSerieBuilder xyzChartSerie(AdhocChartSerie adhocChartSerie)
xyzChartSerie.
adhocChartSerie - a AdhocChartSerie object.XyzChartSerieBuilder object.Copyright © 2010–2021. All rights reserved.