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

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


  private boolean parseLayout(final String layout) throws ParseException
  {
    try
    {
      final SubReport report = (SubReport) performExternalParsing(layout, SubReport.class);
      return report == this.report;
    }
    catch (ResourceLoadingException e)
    {
      SubContentRootElementHandler.logger.warn("Unable to parse the parameter for this bundle from file: " + layout);
View Full Code Here


  private boolean parseStyles(final String stylefile) throws ParseException
  {
    try
    {
      final SubReport report = (SubReport) performExternalParsing(stylefile, SubReport.class);
      return report == this.report;
    }
    catch (ResourceLoadingException e)
    {
      SubContentRootElementHandler.logger.warn("Unable to parse the parameter for this bundle from file: " + stylefile);
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

        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

    {
      report = (SubReport) maybeReport;
    }
    else
    {
      report = new SubReport();
      report.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, rootHandler.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 = importParameters.get(i);
      report.addInputParameter(handler.getName(), handler.getAlias());
    }
    for (int i = 0; i < exportParameters.size(); i++)
    {
      final ParameterMappingReadHandler handler = exportParameters.get(i);
      report.addExportParameter(handler.getAlias(), handler.getName());
    }
    try
    {
      final GroupList clone = (GroupList) groupList.clone();
      clone.installIntoReport(report);
View Full Code Here

    model.addRow("b", "3", "row-6");
    model.addRow("a", "1", "row-7");
    model.addRow("b", "1", "row-8");
    model.addRow("b", "2", "row-9");

    final SubReport report = new SubReport();
    report.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, 200f);
    report.getStyle().setStyleProperty(ElementStyleKeys.POS_X, 100f);
    report.getStyle().setStyleProperty(ElementStyleKeys.POS_Y, 20f);
    report.addGroup(new RelationalGroup());
    report.setDataFactory(new TableDataFactory("query", model));
    report.setQuery("query");

    final RelationalGroup group0 = (RelationalGroup) report.getGroup(0);
    group0.setName("outer-group");
    group0.addField("g0");
    group0.getHeader().addElement(createDataItem("outer-header-field", 100, 20));
    group0.getFooter().addElement(createDataItem("outer-footer-field", 100, 20));
    final RelationalGroup group1 = (RelationalGroup) report.getGroup(1);
    group1.setName("inner-group");
    group1.addField("g1");
    group1.getHeader().addElement(createDataItem("inner-header-field", 100, 20));
    group1.getFooter().addElement(createDataItem("inner-footer-field", 100, 20));
    report.getItemBand().addElement(createFieldItem("detail-field", 100, 20));
    report.getItemBand().getParentSection().getStyle().setStyleProperty(ElementStyleKeys.AVOID_PAGEBREAK_INSIDE, Boolean.TRUE);
    group0.getStyle().setStyleProperty(ElementStyleKeys.AVOID_PAGEBREAK_INSIDE, Boolean.TRUE);

    final MasterReport master = new MasterReport();
    master.setPageDefinition(new SimplePageDefinition(new PageSize(500, 100)));
    master.getReportHeader().addElement(report);
View Full Code Here

  {
    final FormulaExpression function = new FormulaExpression();
    function.setName("out");
    function.setFormula("=output // this formula does not even parse!");
   
    SubReport subReport = new SubReport();
    subReport.addExportParameter("out", "out");
    subReport.addExpression(function);

    MasterReport report = new MasterReport();
    report.setDataFactory(new TableDataFactory(report.getQuery(), new DefaultTableModel(2,2)));
    final RelationalGroup rootGroup = (RelationalGroup) report.getRootGroup();
    rootGroup.getHeader().addSubReport((SubReport) subReport.derive());
    report.getItemBand().addSubReport((SubReport) subReport.derive());

    DebugReportRunner.execGraphics2D(report);

  }
View Full Code Here

  @Test
  public void testExportFormatInValid() throws ReportProcessingException, IOException
  {
    MasterReport report = new MasterReport();
    report.getReportHeader().addElement(new SubReport());
    ByteArrayOutputStream boutFast = new ByteArrayOutputStream();
    ByteArrayOutputStream boutSlow = new ByteArrayOutputStream();
    FastExcelReportUtil.processXlsx(report, boutFast);
    ExcelReportUtil.createXLSX(report, boutSlow);
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

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.