All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.dynamicreports.report.builder.column.ColumnBuilders Maven / Gradle / Ivy

Go to download

DynamicReports is an open source Java reporting library based on JasperReports. It allows to create dynamic report designs and it doesn't need a visual report designer. You can very quickly create reports and produce documents that can be displayed, printed or exported into many popular formats such as PDF, Excel, Word and others.

There is a newer version: 6.20.1
Show newest version
/**
 * DynamicReports - Free Java reporting library for creating reports dynamically
 *
 * Copyright (C) 2010 - 2016 Ricardo Mariaca
 * http://www.dynamicreports.org
 *
 * This file is part of DynamicReports.
 *
 * DynamicReports is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * DynamicReports is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with DynamicReports. If not, see .
 */

package net.sf.dynamicreports.report.builder.column;

import net.sf.dynamicreports.report.builder.FieldBuilder;
import net.sf.dynamicreports.report.builder.component.ComponentBuilder;
import net.sf.dynamicreports.report.definition.datatype.DRIDataType;
import net.sf.dynamicreports.report.definition.expression.DRIExpression;

/**
 * A set of methods of creating report columns.
* It is used to display data in a multi-column layout. * * @author Ricardo Mariaca ([email protected]) */ public class ColumnBuilders { //text /** * Creates a new column.
* It is used to show values from the data source. * * @param fieldName the name of the field * @param valueClass the field value class * @return a column builder */ public TextColumnBuilder column(String fieldName, Class valueClass) { return Columns.column(fieldName, valueClass); } /** * Creates a new column.
* It is used to show values from the data source. * * @param title the column title * @param fieldName the name of the field * @param valueClass the field value class * @return a column builder */ public TextColumnBuilder column(String title, String fieldName, Class valueClass) { return Columns.column(title, fieldName, valueClass); } /** * Creates a new column.
* It is used to show values from the data source. * * @param fieldName the name of the field * @param dataType the field data type * @return a column builder */ public TextColumnBuilder column(String fieldName, DRIDataType dataType) { return Columns.column(fieldName, dataType); } /** * Creates a new column.
* It is used to show values from the data source. * * @param title the column title * @param fieldName the name of the field * @param dataType the field data type * @return a column builder */ public TextColumnBuilder column(String title, String fieldName, DRIDataType dataType) { return Columns.column(title, fieldName, dataType); } /** * Creates a new column.
* It is used to show values from the data source. * * @param field the field definition * @return a column builder */ public TextColumnBuilder column(FieldBuilder field) { return Columns.column(field); } /** * Creates a new column.
* It is used to show values from the data source. * * @param title the column title * @param field the field definition * @return a column builder */ public TextColumnBuilder column(String title, FieldBuilder field) { return Columns.column(title, field); } //expression /** * Creates a new expression column.
* The column values are defined in an expression. * * @param expression the value expression * @return a column builder */ public TextColumnBuilder column(DRIExpression expression) { return Columns.column(expression); } /** * Creates a new expression column.
* The column values are defined in an expression. * * @param title the column title * @param expression the value expression * @return a column builder */ public TextColumnBuilder column(String title, DRIExpression expression) { return Columns.column(title, expression); } //percentage /** * Creates a new percentage column.
* It calculates percentage values from column values. * * @param column the column definition * @return a column builder */ public PercentageColumnBuilder percentageColumn(ValueColumnBuilder column) { return Columns.percentageColumn(column); } /** * Creates a new percentage column.
* It calculates percentage values from column values. * * @param title the column title * @param column the column definition * @return a column builder */ public PercentageColumnBuilder percentageColumn(String title, ValueColumnBuilder column) { return Columns.percentageColumn(title, column); } /** * Creates a new percentage column.
* It calculates percentage values from field values. * * @param fieldName the name of the field * @param valueClass the field value class * @return a column builder */ public PercentageColumnBuilder percentageColumn(String fieldName, Class valueClass) { return Columns.percentageColumn(fieldName, valueClass); } /** * Creates a new percentage column.
* It calculates percentage values from field values. * * @param title the column title * @param fieldName the name of the field * @param valueClass the field value class * @return a column builder */ public PercentageColumnBuilder percentageColumn(String title, String fieldName, Class valueClass) { return Columns.percentageColumn(title, fieldName, valueClass); } /** * Creates a new percentage column.
* It calculates percentage values from field values. * * @param field the field definition * @return a column builder */ public PercentageColumnBuilder percentageColumn(FieldBuilder field) { return Columns.percentageColumn(field); } /** * Creates a new percentage column.
* It calculates percentage values from field values. * * @param title the column title * @param field the field definition * @return a column builder */ public PercentageColumnBuilder percentageColumn(String title, FieldBuilder field) { return Columns.percentageColumn(title, field); } /*public PercentageColumnBuilder percentageColumn(DRISimpleExpression expression) { return Columns.percentageColumn(expression); } public PercentageColumnBuilder percentageColumn(String title, DRISimpleExpression expression) { return Columns.percentageColumn(title, expression); }*/ //column row number /** * Creates a new row number column.
* It displays row numbers, the row number is reset on each new column. * * @return a column builder */ public TextColumnBuilder columnRowNumberColumn() { return Columns.columnRowNumberColumn(); } /** * Creates a new row number column.
* It displays row numbers, the row number is reset on each new column. * * @param title the column title * @return a column builder */ public TextColumnBuilder columnRowNumberColumn(String title) { return Columns.columnRowNumberColumn(title); } //page row number /** * Creates a new row number column.
* It displays row numbers, the row number is reset on each new page. * * @return a column builder */ public TextColumnBuilder pageRowNumberColumn() { return Columns.pageRowNumberColumn(); } /** * Creates a new row number column.
* It displays row numbers, the row number is reset on each new page. * * @param title the column title * @return a column builder */ public TextColumnBuilder pageRowNumberColumn(String title) { return Columns.pageRowNumberColumn(title); } //report row number /** * Creates a new row number column.
* It displays row numbers. * * @return a column builder */ public TextColumnBuilder reportRowNumberColumn() { return Columns.reportRowNumberColumn(); } /** * Creates a new row number column.
* It displays row numbers. * * @param title the column title * @return a column builder */ public TextColumnBuilder reportRowNumberColumn(String title) { return Columns.reportRowNumberColumn(title); } //component /** * Creates a new component column.
* It is used to display custom components (e.g. images or complex content) in columns. * * @param component the component definition * @return a column builder */ public ComponentColumnBuilder componentColumn(ComponentBuilder component) { return Columns.componentColumn(component); } /** * Creates a new component column.
* It is used to display custom components (e.g. images or complex content) in columns. * * @param title the column title * @param component the component definition * @return a column builder */ public ComponentColumnBuilder componentColumn(String title, ComponentBuilder component) { return Columns.componentColumn(title, component); } //boolean /** * Creates a new boolean column.
* It shows a boolean value either as a text or as an image. * * @param fieldName the name of the field * @return a column builder */ public BooleanColumnBuilder booleanColumn(String fieldName) { return Columns.booleanColumn(fieldName); } /** * Creates a new boolean column.
* It shows a boolean value either as a text or as an image. * * @param title the column title * @param fieldName the name of the field * @return a column builder */ public BooleanColumnBuilder booleanColumn(String title, String fieldName) { return Columns.booleanColumn(title, fieldName); } /** * Creates a new boolean column.
* It shows a boolean value either as a text or as an image. * * @param field the field definition * @return a column builder */ public BooleanColumnBuilder booleanColumn(FieldBuilder field) { return Columns.booleanColumn(field); } /** * Creates a new boolean column.
* It shows a boolean value either as a text or as an image. * * @param title the column title * @param field the field definition * @return a column builder */ public BooleanColumnBuilder booleanColumn(String title, FieldBuilder field) { return Columns.booleanColumn(title, field); } /** * Creates a new boolean column.
* It shows a boolean value either as a text or as an image. * * @param expression the boolean value expression * @return a column builder */ public BooleanColumnBuilder booleanColumn(DRIExpression expression) { return Columns.booleanColumn(expression); } /** * Creates a new boolean column.
* It shows a boolean value either as a text or as an image. * * @param title the column title * @param expression the boolean value expression * @return a column builder */ public BooleanColumnBuilder booleanColumn(String title, DRIExpression expression) { return Columns.booleanColumn(title, expression); } //empty column /** * Creates a new empty column.
* * @return a column builder */ public TextColumnBuilder emptyColumn() { return Columns.emptyColumn(); } /** * Creates a new empty column.
* * @param showTitle show column title * @param showDetailRows show detail rows * @return a column builder */ public TextColumnBuilder emptyColumn(boolean showTitle, boolean showDetailRows) { return Columns.emptyColumn(showTitle, showDetailRows); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy