Package net.sf.jasperreports.engine

Examples of net.sf.jasperreports.engine.JRExpressionCollector$GeneratedIds


      collector.collect(dataset);
 
      JRCategorySeries[] categorySeries = dataset.getSeries();
      if (categorySeries != null && categorySeries.length > 0)
      {
        JRExpressionCollector seriesCollector = collector.getCollector(dataset);
        for(int j = 0; j < categorySeries.length; j++)
        {
          seriesCollector.addExpression(categorySeries[j].getSeriesExpression());
          seriesCollector.addExpression(categorySeries[j].getCategoryExpression());
          seriesCollector.addExpression(categorySeries[j].getValueExpression());
          seriesCollector.addExpression(categorySeries[j].getLabelExpression());
 
          seriesCollector.collectHyperlink(categorySeries[j].getItemHyperlink());
         
        }
      }
    }
  }
View Full Code Here


  {
    ListComponent listComponent = (ListComponent) component;
    JRDatasetRun datasetRun = listComponent.getDatasetRun();
    collector.collect(datasetRun);
   
    JRExpressionCollector datasetCollector = collector.getDatasetCollector(
        datasetRun.getDatasetName());
    JRElement[] elements = listComponent.getContents().getElements();
    if (elements != null)
    {
      for (int i = 0; i < elements.length; i++)
View Full Code Here

    TableComponent table = (TableComponent) component;
   
    JRDatasetRun datasetRun = table.getDatasetRun();
    collector.collect(datasetRun);
   
    JRExpressionCollector datasetCollector = collector.getDatasetCollector(
        datasetRun.getDatasetName());
    ColumnExpressionCollector columnCollector = new ColumnExpressionCollector(
        collector, datasetCollector);
    columnCollector.collectColumns(table.getColumns());
  }
View Full Code Here

  {
    // check if the language is supported by the compiler
    checkLanguage(jasperDesign.getLanguage());
   
    // collect all report expressions
    JRExpressionCollector expressionCollector = JRExpressionCollector.collector(jasperDesign);
   
    // verify the report design
    verifyDesign(jasperDesign, expressionCollector);

    String nameSuffix = createNameSuffix();
   
    // check if saving source files is required
    boolean isKeepJavaFile = JRProperties.getBooleanProperty(JRProperties.COMPILER_KEEP_JAVA_FILE);
    File tempDirFile = null;
    if (isKeepJavaFile || needsSourceFiles)
    {
      String tempDirStr = JRProperties.getProperty(JRProperties.COMPILER_TEMP_DIR);

      tempDirFile = new File(tempDirStr);
      if (!tempDirFile.exists() || !tempDirFile.isDirectory())
      {
        throw new JRException("Temporary directory not found : " + tempDirStr);
      }
    }

    List datasets = jasperDesign.getDatasetsList();
    List crosstabs = jasperDesign.getCrosstabs();
   
    JRCompilationUnit[] units = new JRCompilationUnit[datasets.size() + crosstabs.size() + 1];
   
    // generating source code for the main report dataset
    units[0] = createCompileUnit(jasperDesign, jasperDesign.getMainDesignDataset(), expressionCollector, tempDirFile, nameSuffix);

    int sourcesCount = 1;
    for (Iterator it = datasets.iterator(); it.hasNext(); ++sourcesCount)
    {
      JRDesignDataset dataset = (JRDesignDataset) it.next();
      // generating source code for a sub dataset
      units[sourcesCount] = createCompileUnit(jasperDesign, dataset, expressionCollector, tempDirFile, nameSuffix);
    }
   
    for (Iterator it = crosstabs.iterator(); it.hasNext(); ++sourcesCount)
    {
      JRDesignCrosstab crosstab = (JRDesignCrosstab) it.next();
      // generating source code for a sub dataset
      units[sourcesCount] = createCompileUnit(jasperDesign, crosstab, expressionCollector, tempDirFile, nameSuffix);
    }
   
    //TODO component - component compilation units?

    String classpath = JRProperties.getProperty(JRProperties.COMPILER_CLASSPATH);
   
    try
    {
      // compiling generated sources
      String compileErrors = compileUnits(units, classpath, tempDirFile);
      if (compileErrors != null)
      {
        throw new JRException("Errors were encountered when compiling report expressions class file:\n" + compileErrors);
      }

      // creating the report compile data
      JRReportCompileData reportCompileData = new JRReportCompileData();
      reportCompileData.setMainDatasetCompileData(units[0].getCompileData());
     
      for (ListIterator it = datasets.listIterator(); it.hasNext();)
      {
        JRDesignDataset dataset = (JRDesignDataset) it.next();
        reportCompileData.setDatasetCompileData(dataset, units[it.nextIndex()].getCompileData());
      }
     
      for (ListIterator it = crosstabs.listIterator(); it.hasNext();)
      {
        JRDesignCrosstab crosstab = (JRDesignCrosstab) it.next();
        Integer crosstabId = expressionCollector.getCrosstabId(crosstab);
        reportCompileData.setCrosstabCompileData(crosstabId.intValue(), units[datasets.size() + it.nextIndex()].getCompileData());
      }

      // creating the report
      JasperReport jasperReport =
View Full Code Here

  public static void collectExpressions(BarDataset dataset, JRExpressionCollector collector)
  {
    collector.collect(dataset);
   
    JRExpressionCollector datasetCollector = collector.getCollector(dataset);
    for (Iterator it = dataset.getSeries().iterator(); it.hasNext();)
    {
      BarSeries series = (BarSeries) it.next();
      datasetCollector.addExpression(series.getSeriesExpression());
      datasetCollector.addExpression(series.getCategoryExpression());
      datasetCollector.addExpression(series.getValueExpression());
    }
  }
View Full Code Here

  public static void collectExpressions(PieDataset dataset, JRExpressionCollector collector)
  {
    collector.collect(dataset);
   
    JRExpressionCollector datasetCollector = collector.getCollector(dataset);
    datasetCollector.addExpression(dataset.getKeyExpression());
    datasetCollector.addExpression(dataset.getValueExpression());
  }
View Full Code Here

  public static void collectExpressions(AxisDataset dataset, JRExpressionCollector collector)
  {
    collector.collect(dataset);
   
    JRExpressionCollector datasetCollector = collector.getCollector(dataset);
    datasetCollector.addExpression(dataset.getLabelExpression());
    datasetCollector.addExpression(dataset.getValueExpression());
  }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.JRExpressionCollector$GeneratedIds

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.