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

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


    {
      final RootLevelBand rootLevelBand = (RootLevelBand) band;
      final SubReport[] reports = rootLevelBand.getSubReports();
      for (int i = 0; i < reports.length; i++)
      {
        final SubReport report = reports[i];
        if (report.getObjectID() == id)
        {
          return report;
        }
      }
    }
View Full Code Here


      final MasterReport report = new MasterReport();
      report.setDataFactory(new TrackingStaticDataFactory());
      report.setQuery("org.pentaho.reporting.engine.classic.core.bugs.Pre497Test#createMasterReport");
      report.addExpression(new RandomValueExpression("MR"));

      final SubReport sreport = new SubReport();
      sreport.setQuery(SUBREPORT_QUERY);
      sreport.addInputParameter("A", "PA");
      sreport.addExpression(new RandomValueExpression("SR"));
      report.getItemBand().addSubReport(sreport);

      DebugReportRunner.createPDF(report);

      querytracker = null;
View Full Code Here

    super("sub-report", true);
  }

  public ReportElement create()
  {
    return new SubReport();
  }
View Full Code Here

    report.addExpression(new ValidateValueExpression("expression"));
    DebugReportRunner.execGraphics2D(report);
  }

  public SubReport createSubReport() {
    SubReport report = new SubReport();
    report.addExpression(new SingleValueExpression("subreport"));
    report.setInputMappings(new ParameterMapping[]{new ParameterMapping("test-column", "test-column")});
    report.setExportMappings(new ParameterMapping[]{new ParameterMapping("test-column", "test-column")});
    return report;
  }
View Full Code Here

  }

  public void testSubReportFlow() throws Exception
  {
    MasterReport report = new MasterReport();
    report.getReportHeader().addSubReport(new SubReport());
    report.getReportHeader().addElement(new SubReport());

    final LogicalPageBox page = DebugReportRunner.layoutPage(report, 0);

  }
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));
    group0.getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 2);

    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(createDataItem("detail-field", 100, 20));
    report.getItemBand().getParentSection().getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 2);
    group1.getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 2);


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

    model.addRow("b", "3", "row-11");
    model.addRow("a", "1", "row-12");
    model.addRow("b", "1", "row-13");
    model.addRow("b", "2", "row-14");

    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));
    group0.getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 2);

    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.ORPHANS, 200);
    group1.getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 2);

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

    model.addRow("b", "3", "row-12");
    model.addRow("a", "1", "row-13");
    model.addRow("b", "1", "row-14");
    model.addRow("b", "2", "row-15");

    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));
    group0.getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 2);

    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.ORPHANS, 200);
    group1.getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 2);

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

  }

  public void testReport() throws Exception
  {
    MasterReport report = new MasterReport();
    report.getReportHeader().addElement(new SubReport());

    // if the bug is there, it will fail with an StackOverflowError ..
    DebugReportRunner.layoutPage(report, 0);
  }
View Full Code Here

  }

  @Test
  public void testBandedSubReportIsInline() throws Exception
  {
    SubReport subReport = new SubReport();
    subReport.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_INLINE);

    MasterReport report = new MasterReport();
    report.getReportHeader().addSubReport(subReport);
    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
  }
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.