Package net.sf.jasperreports.engine.design

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


          }
         
          JRDatasetRun datasetRun = table.getDatasetRun();
          if (datasetRun != null)
          {
            JRDesignDataset dataset = (JRDesignDataset) verifier.getReportDesign().getDatasetMap().get(
                datasetRun.getDatasetName());
            if (dataset != null && dataset.getGroupsMap().get(groupName) == null)
            {
              verifier.addBrokenRule("No group named " + groupName
                  + "\" found in subdataset " + datasetRun.getDatasetName(),
                  groupCell);
            }
View Full Code Here


    });
   
    JRDatasetRun datasetRun = table.getDatasetRun();
    if (datasetRun != null)
    {
      JRDesignDataset dataset = (JRDesignDataset) verifier.getReportDesign().getDatasetMap().get(
          datasetRun.getDatasetName());
      if (dataset != null)
      {
        JRGroup[] groups = dataset.getGroups();
        if (groups != null)
        {
          for (int i = 0; i < groups.length; i++)
          {
            final String groupName = groups[i].getName();
View Full Code Here

public class JRDatasetFactory extends JRBaseFactory
{
 
  public Object createObject(Attributes attributes)
  {
    JRDesignDataset dataset = new JRDesignDataset(false);
   
    dataset.setName(attributes.getValue(JRXmlConstants.ATTRIBUTE_name));
    dataset.setScriptletClass(attributes.getValue(JRXmlConstants.ATTRIBUTE_scriptletClass));
   
    dataset.setResourceBundle(attributes.getValue(JRXmlConstants.ATTRIBUTE_resourceBundle));

    WhenResourceMissingTypeEnum whenResourceMissingType = WhenResourceMissingTypeEnum.getByName(attributes.getValue(JRXmlConstants.ATTRIBUTE_whenResourceMissingType));
    if (whenResourceMissingType != null)
    {
      dataset.setWhenResourceMissingType(whenResourceMissingType);
    }

    return dataset;
  }
View Full Code Here

   
    JRXmlLoader xmlLoader = (JRXmlLoader) digester.peek(digester.getCount() - 1);
    JasperDesign design = (JasperDesign) digester.peek(digester.getCount() - 2);
    JRDatasetRun datasetRun = (JRDatasetRun) digester.peek(1);
   
    JRDesignDataset dataset = (JRDesignDataset) design.getDatasetMap().get(datasetRun.getDatasetName());
    if (dataset == null)
    {
      xmlLoader.addError(new JRValidationException("Unknown sub dataset " + datasetRun.getDatasetName(), datasetRun));
    }
    else
    {
      JRDatasetParameter runParameter = (JRDatasetParameter) digester.peek();
      JRParameter param = (JRParameter) dataset.getParametersMap().get(runParameter.getName());
     
      if (param == null)
      {
        xmlLoader.addError(new JRValidationException("Unknown parameter " + runParameter.getName() + " in sub dataset " + datasetRun.getDatasetName(), runParameter));
      }
View Full Code Here

    /*   */
    assignGroupsToVariables(jasperDesign.getMainDesignDataset());
    for (Iterator it = jasperDesign.getDatasetsList().iterator(); it.hasNext();)
    {
      JRDesignDataset dataset = (JRDesignDataset) it.next();
      assignGroupsToVariables(dataset);
    }
   
    assignGroupReferences();
    this.assignGroupsToDatasets();
View Full Code Here

      group = (JRGroup) groupsMap.get(groupName);
    }
    else
    {
      String datasetName = context.getSubdatesetName();
      JRDesignDataset dataset = (JRDesignDataset) jasperDesign.getDatasetMap().get(datasetName);
      if (dataset == null)
      {
        throw new JRRuntimeException("Could not find subdataset of name \""
            + datasetName + "\"");
      }
     
      group = (JRGroup) dataset.getGroupsMap().get(groupName);
    }
    return group;
  }
View Full Code Here

      }
      else
      {
        Map datasetMap = jasperDesign.getDatasetMap();
        String datasetName = datasetRun.getDatasetName();
        JRDesignDataset subDataset = (JRDesignDataset) datasetMap.get(datasetName);
        if (subDataset == null)
        {
          throw new JRException("Unknown sub dataset '" + datasetName + "' for chart dataset.");
        }
        groupsMap = subDataset.getGroupsMap();
      }

      if (dataset.getIncrementTypeValue() == IncrementTypeEnum.GROUP)
      {
        String groupName = null;
View Full Code Here


    dataset.setDatasetRun(datasetRun);


    JRDesignDataset jrDataset = new JRDesignDataset(false);
//    jrDataset.setName("sub1");

    for (int i =  rows.length-1; i >= 0; i--) {
      DJCrosstabRow crosstabRow = rows[i];
      JRDesignField field = new JRDesignField();
      field.setName(crosstabRow.getProperty().getProperty());
      field.setValueClassName(crosstabRow.getProperty().getValueClassName());
      try {
        jrDataset.addField(field);
      } catch (JRException e) {
        log.error(e.getMessage(),e);
      }
    }
    for (int i = cols.length-1; i >= 0; i--) {
      DJCrosstabColumn crosstabColumn = cols[i];
      JRDesignField field = new JRDesignField();
      field.setName(crosstabColumn.getProperty().getProperty());
      field.setValueClassName(crosstabColumn.getProperty().getValueClassName());
      try {
        jrDataset.addField(field);
      } catch (JRException e) {
        log.error(e.getMessage(),e);
      }
    }
    JRDesignField field = new JRDesignField();
    field.setName(djcrosstab.getMeasure(0).getProperty().getProperty());
    field.setValueClassName(djcrosstab.getMeasure(0).getProperty().getValueClassName());
    try {
      jrDataset.addField(field);
    } catch (JRException e) {
      log.error(e.getMessage(),e);
    }


    jrcross.setDataset(dataset);
    Random rd = new Random();
    String dsName = "crosstabDataSource_" + rd.nextLong();

    while (design.getDatasetMap().containsKey(dsName)){
      dsName = "crosstabDataSource_" + rd.nextLong();
    }

    datasetRun.setDatasetName(dsName);
    jrDataset.setName(dsName);

    log.debug("Crosstab dataset name = " + dsName);
    try {
        if ( design.getDatasetMap().containsKey(jrDataset.getName())==false)
          design.addDataset(jrDataset);
      } catch (JRException e) {
        //Will never happen
        log.error(e.getMessage(),e);
      }
View Full Code Here

          dr.setQuery(new DJQuery(query.getText(), query
              .getLanguage()));
        }

        for (Iterator iter = jd.getDatasetsList().iterator(); iter.hasNext();) {
          JRDesignDataset dataset = (JRDesignDataset) iter.next();
          try {
            djd.addDataset(dataset);
          } catch (JRException e) {
            if (log.isDebugEnabled()) {
              log.warn(e.getMessage());
View Full Code Here

     
      // get datasets
      List<JRDesignDataset> datasets = jasperDesign.getDatasetsList();

      for (int h =0; h< datasets.size(); h++){
        JRDesignDataset designDataset = datasets.get(h);
        String datasetName = designDataset.getName();
        //get document's dataset
        IDataSet dataset = this.dsProxy.getDataSetByLabel(datasetName);
       
        if (dataset != null) {
          logger.debug("Found SpagoBI dataset "+datasetName);
View Full Code Here

TOP

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

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.