Examples of SubReport


Examples of org.pentaho.reporting.engine.classic.core.SubReport

  {
    final AbstractReportDefinition report = state.getReport();
    if (report instanceof SubReport)
    {
      writer.writeTag(BundleNamespaces.DATADEFINITION, "parameter-mapping", XmlWriterSupport.OPEN);// NON-NLS
      final SubReport subReport = (SubReport) report;
      final ParameterMapping[] inputMappings = subReport.getInputMappings();
      for (int i = 0; i < inputMappings.length; i++)
      {
        final ParameterMapping mapping = inputMappings[i];
        final AttributeList attList = new AttributeList();
        attList.setAttribute(BundleNamespaces.DATADEFINITION, "name", mapping.getName());// NON-NLS
        attList.setAttribute(BundleNamespaces.DATADEFINITION, "alias", mapping.getAlias());// NON-NLS
        writer.writeTag(BundleNamespaces.DATADEFINITION, "input-parameter", attList, XmlWriterSupport.CLOSE);// NON-NLS
      }

      final ParameterMapping[] exportMappings = subReport.getExportMappings();
      for (int i = 0; i < exportMappings.length; i++)
      {
        final ParameterMapping mapping = exportMappings[i];
        final AttributeList attList = new AttributeList();
        attList.setAttribute(BundleNamespaces.DATADEFINITION, "name", mapping.getName());// NON-NLS
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubReport

      throws IOException, ReportWriterException
  {
    final int subReportCount = band.getSubReportCount();
    for (int i = 0; i < subReportCount; i++)
    {
      final SubReport sreport = band.getSubReport(i);
      final ReportWriterContext context =
          new ReportWriterContext(sreport, getReportWriter());
      final SubReportDefinitionWriter writer =
          new SubReportDefinitionWriter(context, getXmlWriter());
      writer.write();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubReport

      throws SAXException
  {
    final RootXmlReadHandler rootHandler = getRootHandler();
    final Object maybeReport = rootHandler.getHelperObject
        (ReportParserUtil.HELPER_OBJ_REPORT_NAME);
    final SubReport report;
    if (maybeReport instanceof SubReport == false)
    {
      // replace it ..
      report = new SubReport();
      report.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource());
    }
    else
    {
      report = (SubReport) maybeReport;
    }

    if (ReportParserUtil.isIncluded(rootHandler) == false)
    {
      final String query = attrs.getValue(getUri(), "query");
      if (query != null)
      {
        report.setQuery(query);
      }
    }

    if (rootHandler.getHelperObject(ExtSubReportReadHandler.ELEMENT_FACTORY_KEY) == null)
    {
      final ElementFactoryCollector elementFactory = new ElementFactoryCollector();
      rootHandler.setHelperObject(ExtSubReportReadHandler.ELEMENT_FACTORY_KEY, elementFactory);
    }
    if (rootHandler.getHelperObject(ExtSubReportReadHandler.STYLE_FACTORY_KEY) == null)
    {
      final StyleKeyFactoryCollector styleKeyFactory = new StyleKeyFactoryCollector();
      rootHandler.setHelperObject(ExtSubReportReadHandler.STYLE_FACTORY_KEY, styleKeyFactory);
    }
    if (rootHandler.getHelperObject(ExtSubReportReadHandler.CLASS_FACTORY_KEY) == null)
    {
      final ClassFactoryCollector classFactory = new ClassFactoryCollector();
      classFactory.configure(rootHandler.getParserConfiguration());
      rootHandler.setHelperObject(ExtSubReportReadHandler.CLASS_FACTORY_KEY, classFactory);
    }
    if (rootHandler.getHelperObject(ExtSubReportReadHandler.DATASOURCE_FACTORY_KEY) == null)
    {
      final DataSourceCollector dataSourceFactory = new DataSourceCollector();
      dataSourceFactory.configure(rootHandler.getParserConfiguration());
      rootHandler.setHelperObject(ExtSubReportReadHandler.DATASOURCE_FACTORY_KEY, dataSourceFactory);
    }
    if (rootHandler.getHelperObject(ExtSubReportReadHandler.TEMPLATE_FACTORY_KEY) == null)
    {
      final TemplateCollector templateFactory = new TemplateCollector();
      templateFactory.configure(rootHandler.getParserConfiguration());
      rootHandler.setHelperObject(ExtSubReportReadHandler.TEMPLATE_FACTORY_KEY, templateFactory);
    }

    report.setName(attrs.getValue(getUri(), "name"));

    rootHandler.setHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME, report);
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubReport

   * @throws SAXException if there is a parsing error.
   */
  protected void doneParsing() throws SAXException
  {
    super.doneParsing();
    final SubReport report = getSubReport();
    for (int i = 0; i < importParameters.size(); i++)
    {
      final ParameterMappingReadHandler handler =
          (ParameterMappingReadHandler) importParameters.get(i);
      report.addInputParameter(handler.getName(), handler.getAlias());
    }
    for (int i = 0; i < exportParameters.size(); i++)
    {
      final ParameterMappingReadHandler handler =
          (ParameterMappingReadHandler) exportParameters.get(i);
      report.addExportParameter(handler.getAlias(), handler.getName());
    }
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubReport

      final LinkedMap values = computeParameterValueSet(mr);
      parameterRow = new ParameterDataRow((String[]) values.keys(new String[values.size()]), values.values());
    }
    else if (parent instanceof SubReport)
    {
      final SubReport sr = (SubReport) parent;
      final ParameterMapping[] inputMappings = sr.getInputMappings();
      final Object[] values = new Object[inputMappings.length];
      final String[] names = new String[inputMappings.length];
      parameterDefinitions = null;
      for (int i = 0; i < inputMappings.length; i++)
      {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubReport

   * @throws org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.ReportWriterException
   *                             if the report serialisation failed.
   */
  public void write() throws IOException, ReportWriterException
  {
    final SubReport report = (SubReport) getReport();
    final XmlWriter xmlWriter = getXmlWriter();

    final AttributeList attList = new AttributeList();
    if (getReportWriter().hasParent() == false)
    {
      attList.addNamespaceDeclaration("", ExtParserModule.NAMESPACE);
    }

    final String query = report.getQuery();
    if (query != null)
    {
      attList.setAttribute(ExtParserModule.NAMESPACE, "query", query);
    }
    xmlWriter.writeTag(ExtParserModule.NAMESPACE,
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubReport

  }

  private void writeParameterDeclaration()
      throws IOException
  {
    final SubReport report = (SubReport) getReport();
    final ParameterMapping[] exportMappings = report.getExportMappings();
    for (int i = 0; i < exportMappings.length; i++)
    {
      final ParameterMapping mapping = exportMappings[i];
      final AttributeList attList = new AttributeList();
      attList.setAttribute(ExtParserModule.NAMESPACE, "name", mapping.getName());
      if (mapping.getAlias().equals(mapping.getName()) == false)
      {
        attList.setAttribute(ExtParserModule.NAMESPACE, "alias", mapping.getAlias());
      }

      getXmlWriter().writeTag(ExtParserModule.NAMESPACE,
          "export-parameter", attList, XmlWriterSupport.CLOSE);
    }

    final ParameterMapping[] importMappings = report.getInputMappings();
    for (int i = 0; i < importMappings.length; i++)
    {
      final ParameterMapping mapping = importMappings[i];
      final AttributeList attList = new AttributeList();
      attList.setAttribute(ExtParserModule.NAMESPACE, "name", mapping.getName());
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubReport

    {
      report = (SubReport) maybeReport;
    }
    else
    {
      report = new SubReport();
      report.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource());
    }

    final int groupCount = report.getGroupCount();
    for (int i = 0; i < groupCount; i++)
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubReport

   * @throws SAXException if there is a parsing error.
   */
  protected void doneParsing() throws SAXException
  {
    super.doneParsing();
    final SubReport report = getSubReport();
    for (int i = 0; i < importParameters.size(); i++)
    {
      final ParameterMappingReadHandler handler =
          (ParameterMappingReadHandler) importParameters.get(i);
      report.addInputParameter(handler.getName(), handler.getAlias());
    }
    for (int i = 0; i < exportParameters.size(); i++)
    {
      final ParameterMappingReadHandler handler =
          (ParameterMappingReadHandler) exportParameters.get(i);
      report.addExportParameter(handler.getAlias(), handler.getName());
    }
    try
    {
      report.setGroups((GroupList) groupList.clone());
    }
    catch (CloneNotSupportedException e)
    {
      throw new ParseException("Failed to add group-list to report", getLocator());
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubReport

      {
        final RootLevelBand rl = (RootLevelBand) element;
        final SubReport[] reports = rl.getSubReports();
        for (int j = 0; j < reports.length; j++)
        {
          final SubReport subReport = reports[j];
          processSection(documentBundle, report, subReport);
        }
      }

      // Process the attributes if they are a resource key
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.