Package net.sf.jasperreports.engine.design

Examples of net.sf.jasperreports.engine.design.JRDesignVariable


   */
  public JRDesignCrosstabMeasure()
  {
    super();
   
    variable = designVariable = new JRDesignVariable();
    designVariable.setCalculation(CalculationEnum.SYSTEM);
    designVariable.setSystemDefined(true);
  }
View Full Code Here


 
  protected JRDesignCrosstabGroup()
  {
    super();
   
    variable = designVariable = new JRDesignVariable();
    designVariable.setCalculation(CalculationEnum.SYSTEM);
    designVariable.setSystemDefined(true);
   
    header = new JRDesignCellContents();
    totalHeader = new JRDesignCellContents();
View Full Code Here

  /**
   *
   */
  public Object createObject(Attributes atts)
  {
    JRDesignVariable variable = (JRDesignVariable)digester.peek();

    JRDesignExpression expression = new JRDesignExpression();
    if (
      variable.getCalculationValue() == CalculationEnum.COUNT
      || variable.getCalculationValue() == CalculationEnum.DISTINCT_COUNT
      )
    {
      expression.setValueClassName(java.lang.Object.class.getName());
    }
    else
    {
      expression.setValueClassName(variable.getValueClassName());
    }

    return expression;
  }
View Full Code Here

  private void addBuiltinVariables()
  {
    for (int i = 0; i < BUILT_IN_VARIABLES.length; ++i)
    {
      JRDesignVariable variable = new JRDesignVariable();
      variable.setName((String) BUILT_IN_VARIABLES[i]);
      variable.setValueClass((Class) BUILT_IN_VARIABLES[++i]);
      variable.setCalculation(CalculationEnum.SYSTEM);
      variable.setSystemDefined(true);
      addVariable(variable);
    }
  }
View Full Code Here

  }


  protected void addTotalVar(JRCrosstabMeasure measure, JRCrosstabRowGroup rowGroup, JRCrosstabColumnGroup colGroup)
  {
    JRDesignVariable var = new JRDesignVariable();
    var.setCalculation(CalculationEnum.SYSTEM);
    var.setSystemDefined(true);
    var.setName(getTotalVariableName(measure, rowGroup, colGroup));
    var.setValueClassName(measure.getValueClassName());
    addVariable(var);
  }
View Full Code Here

    }
  }
 
  protected void setTotalVarClass(JRCrosstabMeasure measure, JRCrosstabRowGroup rowGroup, JRCrosstabColumnGroup colGroup, String valueClassName)
  {
    JRDesignVariable variable = getVariable(getTotalVariableName(measure, rowGroup, colGroup));
    variable.setValueClassName(valueClassName);
  }
View Full Code Here

  /**
   *
   */
  public Object createObject(Attributes atts)
  {
    JRDesignVariable variable = new JRDesignVariable();
   
    variable.setName(atts.getValue(JRXmlConstants.ATTRIBUTE_name));

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_class) != null)
    {
      variable.setValueClassName(atts.getValue(JRXmlConstants.ATTRIBUTE_class));
    }

    ResetTypeEnum resetType = ResetTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_resetType));
    if (resetType != null)
    {
      variable.setResetType(resetType);
    }
   
    String groupName = atts.getValue(JRXmlConstants.ATTRIBUTE_resetGroup);
    if (groupName != null)
    {
      JRDesignGroup group = new JRDesignGroup();
      group.setName(groupName);
      variable.setResetGroup(group);
    }

    IncrementTypeEnum incrementType = IncrementTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_incrementType));
    if (incrementType != null)
    {
      variable.setIncrementType(incrementType);
    }
   
    groupName = atts.getValue(JRXmlConstants.ATTRIBUTE_incrementGroup);
    if (groupName != null)
    {
      JRDesignGroup group = new JRDesignGroup();
      group.setName(groupName);
      variable.setIncrementGroup(group);
    }

    CalculationEnum calculation = CalculationEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_calculation));
    if (calculation != null)
    {
      variable.setCalculation(calculation);
    }

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_incrementerFactoryClass) != null)
    {
      variable.setIncrementerFactoryClassName(atts.getValue(JRXmlConstants.ATTRIBUTE_incrementerFactoryClass));
    }

    return variable;
  }
View Full Code Here

    return variable;
  }

  private JRVariable createHelperVariable(JRVariable variable, String nameSuffix, CalculationEnum calculation)
  {
    JRDesignVariable helper = new JRDesignVariable();
    helper.setName(variable.getName() + nameSuffix);
    helper.setValueClassName(variable.getValueClassName());
    helper.setIncrementerFactoryClassName(variable.getIncrementerFactoryClassName());
    helper.setResetType(variable.getResetTypeValue());
    helper.setResetGroup(variable.getResetGroup());
    helper.setIncrementType(variable.getIncrementTypeValue());
    helper.setIncrementGroup(variable.getIncrementGroup());
    helper.setCalculation(calculation);
    helper.setSystemDefined(true);
    helper.setExpression(variable.getExpression());

    return helper;
  }
View Full Code Here

    return helper;
  }

  private JRVariable createDistinctCountHelperVariable(JRVariable variable)
  {
    JRDesignVariable helper = new JRDesignVariable();
    helper.setName(variable.getName() + "_DISTINCT_COUNT");
    helper.setValueClassName(variable.getValueClassName());
    helper.setIncrementerFactoryClassName(JRDistinctCountIncrementerFactory.class.getName());
    helper.setResetType(ResetTypeEnum.REPORT);

    if (variable.getIncrementTypeValue() != IncrementTypeEnum.NONE)
    {
      helper.setResetType(ResetTypeEnum.getByValue(variable.getIncrementTypeValue().getValue()));
    }
    helper.setResetGroup(variable.getIncrementGroup());
    helper.setCalculation(CalculationEnum.NOTHING);
    helper.setSystemDefined(true);
    helper.setExpression(variable.getExpression());
   
    return helper;
  }
View Full Code Here

  /**
   *
   */
  public Object createObject(Attributes atts)
  {
    JRDesignVariable variable = (JRDesignVariable)digester.peek();

    JRDesignExpression expression = new JRDesignExpression();
    expression.setValueClassName(variable.getValueClassName());

    return expression;
  }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.design.JRDesignVariable

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.