Package net.sf.jasperreports.engine

Examples of net.sf.jasperreports.engine.JRDataset


  private static JRFillDataset createFillDataset(JRDatasetRun datasetRun,
      JRFillObjectFactory factory) throws JRException
  {
    JasperReport jasperReport = factory.getFiller().getJasperReport();
    JRDataset reportDataset = JRReportUtils.findSubdataset(datasetRun, jasperReport);
    JRFillDataset fillDataset = new JRFillDataset(factory.getFiller(), reportDataset, factory);
    fillDataset.createCalculator(jasperReport);
    return fillDataset;
  }
View Full Code Here


  public static List<?> getGroupList(TableComponent table, JasperDesign jd) {
    List<?> groupsList = null;
    JRDatasetRun datasetRun = table.getDatasetRun();
    if (datasetRun != null) {
      String dataSetName = datasetRun.getDatasetName();
      JRDataset ds = (JRDataset) jd.getDatasetMap().get(dataSetName);
      groupsList = (ds != null ? Arrays.asList(ds.getGroups()) : null);
    }
    return groupsList;
  }
View Full Code Here

  }

  protected FillTableSubreport createFillTableSubreport() throws JRException
  {
    JasperReport parentReport = fillContext.getFiller().getJasperReport();
    JRDataset reportSubdataset = JRReportUtils.findSubdataset(table.getDatasetRun(),
        parentReport);
   
    Map<JRExpression, BuiltinExpressionEvaluator> builtinEvaluators =
      new HashMap<JRExpression, BuiltinExpressionEvaluator>();
   
    String tableReportName = JRAbstractCompiler.getUnitName(parentReport, reportSubdataset);
   
    // clone the table subdataset in order to have a different instance for other
    // elements that might be using it.
    // we're cloning the subdataset via an object factory in order to preserve
    // the relationship between objects (e.g. variables and groups) in the cloned
    // dataset
    JRDataset tableSubdataset = DatasetCloneObjectFactory.cloneDataset(reportSubdataset);
    TableReportDataset reportDataset = new TableReportDataset(tableSubdataset, tableReportName);
    TableReport tableReport = new TableReport(fillContext, reportDataset, fillColumns, builtinEvaluators);
   
    if (log.isDebugEnabled())
    {
View Full Code Here

    Map valuesMap = initialParameters == null ? new HashMap() : new HashMap(initialParameters);
   
    valuesMap.put(JRParameter.JASPER_REPORT, report);
   
    ObjectFactory factory = new ObjectFactory();
    JRDataset reportDataset = report.getMainDataset();
    JRFillDataset fillDataset = factory.getDataset(reportDataset);
    fillDataset.createCalculator(report);
    fillDataset.initCalculator();

    JRResourcesFillUtil.ResourcesFillContext resourcesContext =
      JRResourcesFillUtil.setResourcesFillContext(valuesMap);
    try
    {
      fillDataset.setParameterValues(valuesMap);
     
      Map parameterValues = new HashMap();
      JRParameter[] parameters = reportDataset.getParameters();
      for (int i = 0; i < parameters.length; i++)
      {
        JRParameter param = parameters[i];
        if (!param.isSystemDefined())
        {
View Full Code Here

 
  public static JRDataset findSubdataset(JRDatasetRun datasetRun,
      JasperReport report)
  {
    JRDataset[] datasets = report.getDatasets();
    JRDataset reportDataset = null;
    if (datasets != null)
    {
      for (int i = 0; i < datasets.length; i++)
      {
        if (datasetRun.getDatasetName().equals(
View Full Code Here

TOP

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

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.