Package org.jfree.report.expressions

Examples of org.jfree.report.expressions.FormulaExpression


        {
            final Node node = nodes[i];
            if (node instanceof OfficeGroup)
            {
                final OfficeGroup group = (OfficeGroup) node;
                final FormulaExpression exp = (FormulaExpression) group.getGroupingExpression();
                if (exp == null)
                {
                    continue;
                }

                try
                {
                    final String expression = exp.getFormulaExpression();
                    if (expression == null)
                    {
                        continue;
                    }
                    final FormulaFunction function = (FormulaFunction) parser.parse(expression);
                    final LValue[] parameters = function.getChildValues();
                    if (parameters.length > 0)
                    {
                        String name = parameters[0].toString();
                        if (parameters[0] instanceof ContextLookup)
                        {
                            final ContextLookup context = (ContextLookup) parameters[0];
                            name = context.getName();
                        }
                        for (int j = 0; j < reportFunctions.length; j++)
                        {
                            if (reportFunctions[j] instanceof FormulaExpression)
                            {
                                final FormulaExpression reportExp = (FormulaExpression) reportFunctions[j];

                                if (reportExp.getName().equals(name))
                                {
                                    LValue val = parser.parse(reportExp.getFormulaExpression());
                                    while( !(val instanceof ContextLookup))
                                    {
                                        if (val instanceof Term)
                                        {
                                            val = ((Term)val).getHeadValue();
View Full Code Here


        final AttributeMap variableSection = new AttributeMap();
        variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
        variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "variable-set");
        variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "display", "none");

        final FormulaExpression valueExpression = variable.getValueExpression();
        final Object value = LayoutControllerUtil.evaluateExpression(getFlowController(), variable, valueExpression);
        String formula = FormatValueUtility.applyValueForVariable(value, variableSection);
        if (formula == null)
        {
            formula = "" + value;
View Full Code Here

TOP

Related Classes of org.jfree.report.expressions.FormulaExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.