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

ar.com.fdvs.dj.domain.entities.DJGroup Maven / Gradle / Ivy

Go to download

DynamicJasper (DJ) is an API that hides the complexity of Jasper Reports, it helps developers to save time when designing simple/medium complexity reports generating the layout of the report elements automatically. It creates reports dynamically, defining at runtime the columns, column width (auto width), groups, variables, fonts, charts, crosstabs, sub reports (that can also be dynamic), page size and everything else that you can define at design time. DJ keeps full compatibility with Jasper Reports since it's a tool that helps create reports programmatically in a easy way (it only interferes with the creation of the report design doing the layout of the elements). You can use the classic .jrxml files as templates while the content and layout of the report elements are handled by the DJ API. http://dynamicjasper.com

There is a newer version: 5.3.9
Show newest version
/*
 * DynamicJasper: A library for creating reports dynamically by specifying
 * columns, groups, styles, etc. at runtime. It also saves a lot of development
 * time in many cases! (http://sourceforge.net/projects/dynamicjasper)
 *
 * Copyright (C) 2008  FDV Solutions (http://www.fdvsolutions.com)
 *
 * This library 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 2.1 of the License, or (at your option) any later version.
 *
 * This library 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 this library; if not, write to the Free Software
 *
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 *
 */

package ar.com.fdvs.dj.domain.entities;

import ar.com.fdvs.dj.domain.DJBaseElement;
import ar.com.fdvs.dj.domain.DJCrosstab;
import ar.com.fdvs.dj.domain.DJGroupLabel;
import ar.com.fdvs.dj.domain.DynamicReportOptions;
import ar.com.fdvs.dj.domain.Style;
import ar.com.fdvs.dj.domain.constants.GroupLayout;
import ar.com.fdvs.dj.domain.entities.columns.AbstractColumn;
import ar.com.fdvs.dj.domain.entities.columns.PropertyColumn;
import org.apache.commons.collections4.list.UnmodifiableList;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Entity created to handle groups of columns.
* Multiple groups can be created for a single report. In this case the result
* would be a nesting with the latest groups added to the report being the inner ones. */ public class DJGroup extends DJBaseElement { private static final long serialVersionUID = Entity.SERIAL_VERSION_UID; //The column used to group by private PropertyColumn columnToGroupBy; public PropertyColumn getColumnToGroupBy() { return columnToGroupBy; } public void setColumnToGroupBy(PropertyColumn columnToGroupBy) { this.columnToGroupBy = columnToGroupBy; } /** * Map */ private Map columnHeaderStyles = new HashMap(); private Style defaultColumnHeaederStyle; private List headerVariables = new ArrayList(); private List footerVariables = new ArrayList(); private List variables = new ArrayList(); private boolean fitHeaderHeightToContent = true; private boolean fitFooterHeightToContent = true; /** * For internal use only */ private String name; public boolean isFitHeaderHeightToContent() { return fitHeaderHeightToContent; } public void setFitHeaderHeightToContent(boolean fitHeaderHeightToContent) { this.fitHeaderHeightToContent = fitHeaderHeightToContent; } public boolean isFitFooterHeightToContent() { return fitFooterHeightToContent; } /** * When false, the footer height is not shrink to its content (variables in general), leaving a white space * @param fitFooterHeightToContent */ public void setFitFooterHeightToContent(boolean fitFooterHeightToContent) { this.fitFooterHeightToContent = fitFooterHeightToContent; } private int headerHeight = DynamicReportOptions.DEFAULT_HEADER_HEIGHT; //for headers private int footerHeight = DynamicReportOptions.DEFAULT_FOOTER_VARIABLES_HEIGHT; //for headers private int headerVariablesHeight = DynamicReportOptions.UNSET_VALUE; //for values such as calculations, current value, etc. private int footerVariablesHeight = DynamicReportOptions.UNSET_VALUE; //for values such as calculations, current value, etc. private GroupLayout layout = GroupLayout.DEFAULT; private List footerSubreports = new ArrayList(); private List headerSubreports = new ArrayList(); private List headerCrosstabs = new ArrayList(); private List footerCrosstabs = new ArrayList(); private boolean startInNewPage = false; private boolean startInNewColumn = false; /** * If the group is configured to print column names, they will be printed on every page * (even if a group is splitted in two pages) * NOTE: this may cause unexpected results if header variables are present. */ private boolean reprintHeaderOnEachPage = false; /** * Same as in JasperReports */ private boolean resetPageNumber = false; private DJGroupLabel footerLabel; //general label, goes at the right of the group variables /** * pass-through property to setup group header band "allowSplit" property. * When FALSE, if the content reaches end of the page, the whole band gets pushed * to the next page. */ private boolean allowHeaderSplit = true; /** * pass-through property to setup group footer band "allowSplit" property. * When FALSE, if the content reaches end of the page, the whole band gets pushed * to the next page. */ private boolean allowFooterSplit = true; /** * Default Style for variables when showing in footer. * First looks for the style at the ColumnsGroupVariable, then the default, finally * it uses the columns style. */ private Style defaulFooterVariableStyle; /** * Default Style for variables when showing in header. * The lookup order is the same as for "defaulFooterStyle" */ private Style defaulHeaderVariableStyle; public Style getDefaulFooterVariableStyle() { return defaulFooterVariableStyle; } public void setDefaulFooterVariableStyle(Style defaulFooterStyle) { this.defaulFooterVariableStyle = defaulFooterStyle; } public Style getDefaulHeaderVariableStyle() { return defaulHeaderVariableStyle; } public void setDefaulHeaderVariableStyle(Style defaulHeaderStyle) { this.defaulHeaderVariableStyle = defaulHeaderStyle; } public List getFooterVariables() { return new UnmodifiableList(footerVariables); } public void setFooterVariables(List footerVariables) { this.footerVariables = footerVariables; } public List getHeaderVariables() { return new UnmodifiableList(headerVariables); } public void setHeaderVariables(List headerVariables) { this.headerVariables = headerVariables; } public List getVariables() { return variables; } public void setVariables(List variables) { this.variables = variables; } public int getFooterHeight() { return footerHeight; } public void setFooterHeight(int footerHeight) { this.footerHeight = footerHeight; } public int getHeaderHeight() { return headerHeight; } public void setHeaderHeight(int headerHeight) { this.headerHeight = headerHeight; } public GroupLayout getLayout() { return layout; } public void setLayout(GroupLayout layout) { this.layout = layout; } public List getFooterSubreports() { return footerSubreports; } public List getHeaderSubreports() { return headerSubreports; } public void setStartInNewPage(boolean startInNewPage) { this.startInNewPage = startInNewPage; } public void setStartInNewColumn(boolean startInNewColumn) { this.startInNewColumn = startInNewColumn; } public List getHeaderCrosstabs() { return headerCrosstabs; } public void setHeaderCrosstabs(List headerCrosstabs) { this.headerCrosstabs = headerCrosstabs; } public List getFooterCrosstabs() { return footerCrosstabs; } public void setFooterCrosstabs(List footerCrosstabs) { this.footerCrosstabs = footerCrosstabs; } public Map getColumnHeaderStyles() { return columnHeaderStyles; } public void setColumnHeaderStyles(Map columnHeaderStyles) { this.columnHeaderStyles = columnHeaderStyles; } public void addColumHeaderStyle(AbstractColumn col, Style style) { columnHeaderStyles.put(col, style); } public Style getColumnHeaderStyle(AbstractColumn col) { if (this.columnHeaderStyles == null) return null; return this.columnHeaderStyles.get(col); } public Style getDefaultColumnHeaederStyle() { return defaultColumnHeaederStyle; } public void setDefaultColumnHeaederStyle(Style defaultColumnHeaederStyle) { this.defaultColumnHeaederStyle = defaultColumnHeaederStyle; } public boolean isAllowHeaderSplit() { return allowHeaderSplit; } public void setAllowHeaederSplit(boolean allowHeaederSplit) { this.allowHeaderSplit = allowHeaederSplit; } public boolean isAllowFooterSplit() { return allowFooterSplit; } public void setAllowFooterSplit(boolean allowFooterSplit) { this.allowFooterSplit = allowFooterSplit; } public int getHeaderVariablesHeight() { return headerVariablesHeight; } public void setHeaderVariablesHeight(int headerVariablesHeight) { this.headerVariablesHeight = headerVariablesHeight; } public int getFooterVariablesHeight() { return footerVariablesHeight; } public void setFooterVariablesHeight(int footerVariablesHeight) { this.footerVariablesHeight = footerVariablesHeight; } public void addHeaderVariable(DJGroupVariable var) { headerVariables.add(var); var.setGroup(this); } public void addFooterVariable(DJGroupVariable var) { footerVariables.add(var); var.setGroup(this); } public void addVariable(DJGroupVariableDef var) { variables.add(var); } public DJGroupLabel getFooterLabel() { return footerLabel; } public void setFooterLabel(DJGroupLabel footerLabel) { this.footerLabel = footerLabel; } public boolean isReprintHeaderOnEachPage() { return reprintHeaderOnEachPage; } public void setReprintHeaderOnEachPage(boolean reprintHeaderOnEachPage) { this.reprintHeaderOnEachPage = reprintHeaderOnEachPage; } public void addHeaderCrosstab(DJCrosstab cross){ this.headerCrosstabs.add(cross); } public void addFooterCrosstab(DJCrosstab cross){ this.footerCrosstabs.add(cross); } public void setName(String name) { this.name = name; } public String getName() { return name; } public boolean isResetPageNumber() { return resetPageNumber; } public void setResetPageNumber(boolean resetPageNumber) { this.resetPageNumber = resetPageNumber; } public boolean isStartInNewPage() { return startInNewPage; } public boolean isStartInNewColumn() { return startInNewColumn; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy