net.sf.dynamicreports.jasper.transformation.MainDatasetExpressionTransform Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamicreports-core Show documentation
Show all versions of dynamicreports-core Show documentation
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.
/**
* 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.jasper.transformation;
import java.util.Collection;
import net.sf.dynamicreports.design.definition.DRIDesignField;
import net.sf.dynamicreports.design.definition.DRIDesignGroup;
import net.sf.dynamicreports.design.definition.DRIDesignSort;
import net.sf.dynamicreports.design.definition.DRIDesignVariable;
import net.sf.dynamicreports.design.definition.expression.DRIDesignComplexExpression;
import net.sf.dynamicreports.design.definition.expression.DRIDesignJasperExpression;
import net.sf.dynamicreports.design.definition.expression.DRIDesignSimpleExpression;
import net.sf.dynamicreports.design.definition.expression.DRIDesignSystemExpression;
import net.sf.dynamicreports.jasper.base.JasperCustomValues;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRGroup;
import net.sf.jasperreports.engine.design.JRDesignField;
import net.sf.jasperreports.engine.design.JRDesignSortField;
import net.sf.jasperreports.engine.design.JRDesignVariable;
/**
* @author Ricardo Mariaca ([email protected])
*/
public class MainDatasetExpressionTransform extends AbstractExpressionTransform {
private JasperTransformAccessor accessor;
public MainDatasetExpressionTransform(JasperTransformAccessor accessor) {
this.accessor = accessor;
}
@Override
protected JasperCustomValues getCustomValues() {
return accessor.getCustomValues();
}
@Override
protected JRGroup getGroup(DRIDesignGroup group) {
return accessor.getGroupTransform().getGroup(group);
}
@Override
protected Collection getFields() {
return accessor.getReport().getFields();
}
@Override
protected Collection getVariables() {
return accessor.getReport().getVariables();
}
@Override
protected Collection getSystemExpressions() {
return accessor.getReport().getSystemExpressions();
}
@Override
protected Collection getJasperExpressions() {
return accessor.getReport().getJasperExpressions();
}
@Override
protected Collection getSimpleExpressions() {
return accessor.getReport().getSimpleExpressions();
}
@Override
protected Collection getComplexExpressions() {
return accessor.getReport().getComplexExpressions();
}
@Override
protected Collection getSorts() {
return accessor.getReport().getSorts();
}
@Override
protected void addField(JRDesignField field) throws JRException {
accessor.getDesign().addField(field);
}
@Override
protected void addVariable(JRDesignVariable variable) throws JRException {
accessor.getDesign().addVariable(variable);
}
@Override
protected void addSort(JRDesignSortField sort) throws JRException {
accessor.getDesign().addSortField(sort);
}
}