Package org.pentaho.reporting.engine.classic.core

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


   * @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

  }

  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

    {
      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

   * @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

      {
        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

  protected Object finishResult(final Object res,
                                final ResourceManager manager,
                                final ResourceData data,
                                final ResourceKey context) throws ResourceCreationException, ResourceLoadingException
  {
    final SubReport report = (SubReport) res;
    if (report == null)
    {
      throw new ResourceCreationException("Report has not been parsed.");
    }

    // subreports use the content-base of their master-report for now. This is safe for the old platform reports
    // and for bundle-reports.
    report.setDefinitionSource(data.getKey());
    return report;

  }
View Full Code Here

        throw new ParseException("The specified subreport was not found or could not be loaded.", e, getLocator());
      }
    }
    else
    {
      report = new SubReport();
    }

    final String query = attrs.getValue(getUri(), "query");
    if (query != null)
    {
View Full Code Here

    else
    {
      if (ReportParserUtil.INCLUDE_PARSING_VALUE.equals(getRootHandler().getHelperObject
          (ReportParserUtil.INCLUDE_PARSING_KEY)))
      {
        report = new SubReport();
      }
      else
      {
        report = new MasterReport();
      }
View Full Code Here

  {
    final Object maybeReport = getRootHandler().getHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME);
    if (maybeReport instanceof SubReport == false)
    {
      // replace it ..
      report = new SubReport();
      getRootHandler().setHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME, report);
    }
    else
    {
      report = (SubReport) maybeReport;
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.SubReport

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.