Package net.sf.jasperreports.engine

Examples of net.sf.jasperreports.engine.JRGroup


    if (groups != null && groups.length > 0)
    {
      boolean isMainDataset = dataset.isMainDataset();
      for(int index = 0; index < groups.length; index++)
      {
        JRGroup group = groups[index];

        if (group.getName() == null || group.getName().trim().length() == 0)
        {
          addBrokenRule("Group name missing.", group);
        }

        if (isMainDataset)
        {
          verifyGroupHeaderAndFooter(group);
        }
        else
        {
          if (
            (group.getGroupHeaderSection() != null
            && group.getGroupHeaderSection().getBands() != null
            && group.getGroupHeaderSection().getBands().length > 0)
            || (group.getGroupFooterSection() != null
            && group.getGroupFooterSection().getBands() != null
            && group.getGroupFooterSection().getBands().length > 0)
            )
          {
            addBrokenRule("Group " + group.getName() + " cannot have header or footer sections.", group);
          }
        }

        JRExpression expression = group.getExpression();

        if (expression != null)
        {
          try
          {
            Class clazz = expression.getValueClass();
            if (clazz == null)
            {
              addBrokenRule("Class not set for group expression : " + group.getName(), expression);
            }
          }
          catch (JRRuntimeException e)
          {
            addBrokenRule(e, expression);
          }
        }

        if (isMainDataset)
        {
          verifySection(group.getGroupHeaderSection());
          verifySection(group.getGroupFooterSection());
        }
      }
    }
  }
View Full Code Here


    JRGroup[] groups = report.getGroups();
    if (groups != null)
    {
      for(int i = 0; i < groups.length; i++)
      {
        JRGroup group = groups[i];
        visitSection(group.getGroupHeaderSection());
        visitSection(group.getGroupFooterSection());
      }
    }
  }
View Full Code Here

    {
      clone.groupsList = new ArrayList(groupsList.size());
      clone.groupsMap = new HashMap(groupsList.size());
      for(int i = 0; i < groupsList.size(); i++)
      {
        JRGroup group =
          (JRGroup)((JRGroup)groupsList.get(i)).clone();
        clone.groupsList.add(group);
        clone.groupsMap.put(group.getName(), group);
      }
    }
   
    return clone;
  }
View Full Code Here

    }

    List<?> groupsList = getGroupList();
    if (groupsList != null)
      for (Iterator<?> it = groupsList.iterator(); it.hasNext();) {
        JRGroup jrGroup = (JRGroup) it.next();
        y += h;
        r = new Rectangle(0, y, 0, 0);
        h = 0;
        for (BaseColumn bc : table.getColumns()) {
          r = initHeader(r, bc, COLUMN_GROUP_HEADER, jrGroup.getName());
          r.setLocation(r.x, y);
          if (h < r.height)
            h = r.height;
        }
      }

    y += h;
    r = new Rectangle(0, y, 0, 0);
    h = 0;
    for (BaseColumn bc : allColumns) {
      r = initDetail(r, bc);
      r.setLocation(r.x, y);
      if (h < r.height)
        h = r.height;
    }

    if (groupsList != null)
      for (ListIterator<?> it = groupsList.listIterator(groupsList.size()); it.hasPrevious();) {
        JRGroup jrGroup = (JRGroup) it.previous();
        y += h;
        r = new Rectangle(0, y, 0, 0);
        h = 0;
        for (BaseColumn bc : table.getColumns()) {
          r = initFooter(r, bc, COLUMN_GROUP_FOOTER, jrGroup.getName());
          r.setLocation(r.x, y);
          if (h < r.height)
            h = r.height;
        }
      }
View Full Code Here

  }
 
  @Override
  protected JRBaseGroup getGroup(JRGroup group)
  {
    JRGroup origGroup;
    if (tableGroupMap.containsKey(group))
    {
      origGroup = tableGroupMap.get(group);
    }
    else
View Full Code Here

      {
        JRDesignVariable variable = (JRDesignVariable)variables[i];
        if (variable.getResetTypeValue() == ResetTypeEnum.GROUP)
        {
          String groupName = null;
          JRGroup group = variable.getResetGroup();
          if (group != null)
          {
            groupName = group.getName();
            group = (JRGroup)groupsMap.get(groupName);
          }

          if (!ignoreConsistencyProblems && group == null)
          {
            throw
              new JRValidationException(
                "Unknown reset group '" + groupName
                + "' for variable : " + variable.getName(),
                variable
                );
          }

          variable.setResetGroup(group);
        }
        else
        {
          variable.setResetGroup(null);
        }

        if (variable.getIncrementTypeValue() == IncrementTypeEnum.GROUP)
        {
          String groupName = null;
          JRGroup group = variable.getIncrementGroup();
          if (group != null)
          {
            groupName = group.getName();
            group = (JRGroup)groupsMap.get(groupName);
          }

          if (!ignoreConsistencyProblems && group == null)
          {
View Full Code Here

    {
      XmlGroupReference reference = entry.getKey();
      XmlLoaderReportContext context = entry.getValue();

      String groupName = null;
      JRGroup group = reference.getGroupReference();
      if (group != null)
      {
        groupName = group.getName();
        group = resolveGroup(groupName, context);
      }

      if (!ignoreConsistencyProblems && group == null)
      {
View Full Code Here

    }
  }
 
  protected JRGroup resolveGroup(String groupName, XmlLoaderReportContext context)
  {
    JRGroup group;
    if (context == null)
    {
      // main dataset groups
      Map groupsMap = jasperDesign.getGroupsMap();
      group = (JRGroup) groupsMap.get(groupName);
View Full Code Here

      }

      if (dataset.getIncrementTypeValue() == IncrementTypeEnum.GROUP)
      {
        String groupName = null;
        JRGroup group = dataset.getIncrementGroup();
        if (group != null)
        {
          groupName = group.getName();
          group = (JRGroup)groupsMap.get(group.getName());
        }

        if (!ignoreConsistencyProblems && group == null)
        {
          throw new JRValidationException("Unknown increment group '" + groupName + "' for chart dataset.", dataset);
        }

        dataset.setIncrementGroup(group);
      }
      else
      {
        dataset.setIncrementGroup(null);
      }

      if (dataset.getResetTypeValue() == ResetTypeEnum.GROUP)
      {
        String groupName = null;
        JRGroup group = dataset.getResetGroup();
        if (group != null)
        {
          groupName = group.getName();
          group = (JRGroup)groupsMap.get(group.getName());
        }

        if (!ignoreConsistencyProblems && group == null)
        {
          throw new JRValidationException("Unknown reset group '" + groupName + "' for chart dataset.", dataset);
View Full Code Here

        groupEvaluationTimes[i] = JREvaluationTime.getGroupEvaluationTime(groups[i].getName());
      }

      for (int i = 0; i < groups.length; i++)
      {
        JRGroup group = groups[i];
        JRFillSection footer = (JRFillSection) group.getGroupFooterSection();

        for (int j = i; j < groupEvaluationTimes.length; ++j)
        {
          footer.addNowEvaluationTime(groupEvaluationTimes[j]);
        }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.JRGroup

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.