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

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


      return new SectionEditUndoEntry(g.getObjectID(), ModelUtility.findIndexOf(g, newFooter), oldFooter, newFooter);
    }
    if (data instanceof ReportHeader)
    {
      final AbstractReportDefinition g = (AbstractReportDefinition) parent;
      final ReportHeader oldHeader = g.getReportHeader();
      final ReportHeader newHeader = new ReportHeader();
      g.setReportHeader(newHeader);
      return new SectionEditUndoEntry(g.getObjectID(), ModelUtility.findIndexOf(g, newHeader), oldHeader, newHeader);
    }
    if (data instanceof PageHeader)
    {
View Full Code Here


   *
   * @return the report header.
   */
  private ReportHeader createReportHeader()
  {
    final ReportHeader header = new ReportHeader();
    header.setName("Report-Header");
    header.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(48));
    header.getStyle().setStyleProperty(TextStyleKeys.FONT, "Serif");
    header.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(20));
    header.getStyle().setStyleProperty(TextStyleKeys.BOLD, Boolean.TRUE);

    final LabelElementFactory factory = new LabelElementFactory();
    factory.setName("Report-Header-Label");
    factory.setAbsolutePosition(new Point2D.Float(0, 0));
    factory.setMinimumSize(new FloatDimension(-100, 24));
    factory.setHorizontalAlignment(ElementAlignment.CENTER);
    factory.setVerticalAlignment(ElementAlignment.MIDDLE);
    factory.setText("LIST OF CONTINENTS BY COUNTRY");
    header.addElement(factory.createElement());
    return header;
  }
View Full Code Here

    autoTable.setName("AutoTable");
    table.addElement(autoTable);

    final MasterReport report = new MasterReport();
    report.setStrictLegacyMode(false);
    final ReportHeader band = report.getReportHeader();
    band.addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.INSTANCE.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
View Full Code Here

    table.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, 200f);
    table.addElement(tableHeader);
    table.addElement(createBodyBox("body"));

    final MasterReport report = new MasterReport();
    final ReportHeader band = report.getReportHeader();
    band.addElement(table);

    final MemoryByteArrayOutputStream outputStream = new MemoryByteArrayOutputStream();
    HtmlReportUtil.createStreamHTML(report, outputStream);

    final String htmlText = new String(outputStream.toByteArray(), "UTF-8");
View Full Code Here

  public void testBigBadCrash() throws Exception
  {
    final MasterReport report = new MasterReport();
    report.setPageDefinition(new SimplePageDefinition(new PageFormat()));

    final ReportHeader header = report.getReportHeader();

    final Band b = new Band ();
    b.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "row");
    b.getStyle().setStyleProperty(ElementStyleKeys.VALIGNMENT, ElementAlignment.MIDDLE);
    b.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, new Float (500));
    b.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float (100));
    b.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_WIDTH, new Float(2));
    b.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_WIDTH, new Float(2));
    b.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_STYLE, BorderStyle.SOLID);
    b.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_STYLE, BorderStyle.SOLID);
    addLabel("Text 1", b, 20);
    addLabel("Text 2", b, 40);

    header.addElement(b);

    final LogicalPageBox logicalPageBox =
        DebugReportRunner.layoutSingleBand(report, report.getReportHeader(), false, false);
    // simple test, we assert that all paragraph-poolboxes are on either 485000 or 400000
    // and that only two lines exist for each
View Full Code Here

    MasterReport report = DebugReportRunner.parseGoldenSampleReport("Prd-3529.prpt");
    // to enable the complex-processing mode, set this configuration option to true
    report.getReportConfiguration().setConfigProperty
        (ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "true");

    ReportHeader reportHeader = report.getReportHeader();
    LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, reportHeader);

    // this creates a print-out of the layout. This is great to quickly see what the layouter produces.
    ModelPrinter.INSTANCE.print(logicalPageBox);
View Full Code Here

    // x=5%, y=55%, width=40%, height=40%
    levelA2.addElement(createBand("A2-B1", Color.red, 0, -50, -50, -50));
    // x=55%, y=5%, width=40%, height=40%
    levelA2.addElement(createBand("A2-B2", Color.darkGray, -55, -5, -40, -40));

    final ReportHeader header = new ReportHeader();
    header.setName("Report-Header");
    header.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, new Float(-100));
    header.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(100));
    header.getStyle().setStyleProperty(ElementStyleKeys.MAX_WIDTH, new Float(Short.MAX_VALUE));
    header.getStyle().setStyleProperty(ElementStyleKeys.MAX_HEIGHT, new Float(100));

    header.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, Color.ORANGE);

    header.addElement(levelA1);
    header.addElement(levelA2);

    final ContentFieldElementFactory cfef = new ContentFieldElementFactory();
    cfef.setFieldname("CreateComponent");
    cfef.setMinimumSize(new FloatDimension(400, 400));
    cfef.setAbsolutePosition(new Point2D.Float(0, 0));
View Full Code Here

    b.addElement(TableTestUtil.createDataItem("Test"));
    b.setVisible(false);

    MasterReport report = new MasterReport();
    report.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "false");
    ReportHeader reportHeader = report.getReportHeader();
    reportHeader.setLayout(BandStyleKeys.LAYOUT_ROW);
    reportHeader.addElement(b);
    reportHeader.getStyle().setStyleProperty(ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, false);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, reportHeader);

    RenderNode[] elementsByNodeType = MatchFactory.findElementsByNodeType(logicalPageBox, LayoutNodeTypes.TYPE_NODE_TEXT);
    Assert.assertEquals(0, elementsByNodeType.length);
View Full Code Here

    b.addElement(TableTestUtil.createDataItem("Test"));
    b.setVisible(false);

    MasterReport report = new MasterReport();
    report.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "false");
    ReportHeader reportHeader = report.getReportHeader();
    reportHeader.setLayout(BandStyleKeys.LAYOUT_ROW);
    reportHeader.addElement(b);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, reportHeader);
    RenderNode[] elementsByNodeType = MatchFactory.findElementsByNodeType(logicalPageBox, LayoutNodeTypes.TYPE_NODE_TEXT);
    Assert.assertEquals(1, elementsByNodeType.length);
  }
View Full Code Here

  public void testSimpleReport() throws ReportProcessingException, ContentProcessingException
  {
    MasterReport report = new MasterReport();
    report.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "false");
    ReportHeader reportHeader = report.getReportHeader();
    reportHeader.setLayout(BandStyleKeys.LAYOUT_ROW);
    reportHeader.addElement(TableTestUtil.createDataItem("Test"));
    reportHeader.getStyle().setStyleProperty(ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, false);
    reportHeader.setVisible(false);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, reportHeader);
    RenderNode[] elementsByNodeType = MatchFactory.findElementsByNodeType(logicalPageBox, LayoutNodeTypes.TYPE_NODE_TEXT);
    Assert.assertEquals(0, elementsByNodeType.length);
  }
View Full Code Here

TOP

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

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.