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

Examples of org.pentaho.reporting.engine.classic.core.util.PageFormatFactory


    // we redefine it for every page, as we do not assume that the page sizes
    // will be the same for the whole report.
    final int lines = (int) ((paper.getHeight() / 72.0f) * getLinesPerInch());
    sendDefinePageLengthInLines(lines);

    final PageFormatFactory fact = PageFormatFactory.getInstance();
    final int borderLeft = (int) (fact.getLeftBorder(paper) / charWidthPoints);
    final int borderRight = (int) (fact.getRightBorder(paper) / charWidthPoints);

    final int borderTop = (int) (fact.getTopBorder(paper) / lineHeightPoints);
    sendDefineHorizontalBorders(borderLeft, borderRight);

    // print the top margin ..
    for (int i = 0; i < borderTop; i++)
    {
View Full Code Here



  public void run(final OutputProcessorMetaData metaData) throws ResourceKeyCreationException, ContentProcessingException, ReportProcessingException
  {
    // Set up the process ..
    final PageFormatFactory fmFactory = PageFormatFactory.getInstance();
    final PageFormat pageFormat = new PageFormat();
    pageFormat.setPaper(fmFactory.createPaper((double) sequence.getPageWidth(), 1000d));

    final SimplePageDefinition pageDefinition = new SimplePageDefinition(pageFormat);
    final ProcessingContext processingContext = new DefaultProcessingContext();
    final DebugExpressionRuntime runtime = new DebugExpressionRuntime(new DefaultTableModel(), 0, processingContext);
View Full Code Here

      final EncodingUtilities encodingUtilities = getEncodingUtilities(encoding);
      out.write(encodingUtilities.getEncodingHeader());
      firstPage = false;
    }

    final PageFormatFactory fact = PageFormatFactory.getInstance();
    final float charWidthPoints = 72.0f / getCharactersPerInch();
    borderLeft = (int) (fact.getLeftBorder(paper) / charWidthPoints);

    final float lineHeightPoints = 72.0f / getLinesPerInch();
    final int borderTop = (int) (fact.getTopBorder(paper) / lineHeightPoints);

    for (int i = 0; i < borderTop; i++)
    {
      startLine();
      endLine(false);
View Full Code Here

    final int lines = (int) ((paper.getHeight() / 72.0f) * getLinesPerInch());
    sendDefinePageLengthInLines(lines);

    sendDefineCharacterWidth(getCharactersPerInch());

    final PageFormatFactory fact = PageFormatFactory.getInstance();
    final int borderLeft = (int) (fact.getLeftBorder(paper) / charWidthPoints);
    final int borderRight = (int) (fact.getRightBorder(paper) / charWidthPoints);
    sendDefineHorizontalBorders(borderLeft, borderRight);

    final int borderTop = (int) (fact.getTopBorder(paper) / lineHeightPoints);
    //borderBottom = (int) (fact.getBottomBorder(paper) / lineHeightPoints);

    // print the top margin ..
    for (int i = 0; i < borderTop; i++)
    {
View Full Code Here

      tableDataFactory.queryData("table" + a, null);
    }
    report.setDataFactory(tableDataFactory);
    report.setName("Raportti");

    PageFormatFactory pfFact = PageFormatFactory.getInstance();
    // 0.8.9.4
    Paper paper = pfFact.createPaper(PageSize.A4);
    // // 0.8.8-01 (works also with 0.8.9.4 although deprecated)
    // Paper paper = pfFact.createPaper(PageFormatFactory.A4);
    pfFact.setBordersMm(paper, 25.5, 25.5, 25.5, 25.5);
    PageFormat pf = pfFact.createPageFormat(paper, PageFormat.LANDSCAPE);
    SimplePageDefinition pageDef = new SimplePageDefinition(pf);
    report.setPageDefinition(pageDef);

    ReportHeader header = new ReportHeader();
    header.setName("Report-Header");
View Full Code Here

        return new PageFormat();
      }

      final PageFormat pageFormat = pageDefinition.getPageFormat();
      final Paper orgPaper = pageFormat.getPaper();
      final PageFormatFactory pff = PageFormatFactory.getInstance();

      final double virtualPaperWidth = orgPaper.getImageableWidth() +
          pff.getLeftBorder(orgPaper) + pff.getRightBorder(orgPaper);
      final double virtualPaperHeight = orgPaper.getImageableHeight() +
          pff.getTopBorder(orgPaper) + pff.getBottomBorder(orgPaper);

      final Paper p = pff.createPaper(virtualPaperWidth, virtualPaperHeight);
      pff.setBorders(p, pff.getTopBorder(orgPaper), pff.getLeftBorder(orgPaper),
          pff.getBottomBorder(orgPaper), pff.getRightBorder(orgPaper));
      return pff.createPageFormat(p, pageFormat.getOrientation());
    }
View Full Code Here

  }

  private void copyPageFormatToFields(final PageFormat pageFormat)
  {
    final Paper paper = pageFormat.getPaper();
    final PageFormatFactory pageFormatFactory = PageFormatFactory.getInstance();
    final String formatName = pageFormatFactory.getPageFormatName(paper.getWidth(), paper.getHeight());
    pageFormatBox.setSelectedItem(formatName);
    pageWidthField.setText(String.valueOf(paper.getWidth()));
    pageHeightField.setText(String.valueOf(paper.getHeight()));
    userDefinedPageSizeBox.setSelected(formatName == null);
    preDefinedPageSizeBox.setSelected(formatName != null);

    final boolean portraitMode = pageFormat.getOrientation() == PageFormat.PORTRAIT;
    portraitModeBox.setSelected(portraitMode);
    landscapeModeBox.setSelected(portraitMode == false);

    if (portraitMode)
    {
      marginLeftField.setText(String.valueOf(pageFormatFactory.getLeftBorder(paper)));
      marginTopField.setText(String.valueOf(pageFormatFactory.getTopBorder(paper)));
      marginRightField.setText(String.valueOf(pageFormatFactory.getRightBorder(paper)));
      marginBottomField.setText(String.valueOf(pageFormatFactory.getBottomBorder(paper)));
    }
    else
    {
      marginTopField.setText(String.valueOf(pageFormatFactory.getLeftBorder(paper)));
      marginLeftField.setText(String.valueOf(pageFormatFactory.getTopBorder(paper)));
      marginBottomField.setText(String.valueOf(pageFormatFactory.getRightBorder(paper)));
      marginRightField.setText(String.valueOf(pageFormatFactory.getBottomBorder(paper)));
    }
  }
View Full Code Here

    final MasterReport report = new MasterReport();
    report.setName("Survey Scale Demo Report");

    // use A4...
    final PageFormatFactory pff = PageFormatFactory.getInstance();
    final Paper paper = pff.createPaper(PageSize.A4);
    pff.setBorders(paper, PAGE_MARGIN_TOP, PAGE_MARGIN_LEFT, PAGE_MARGIN_BOTTOM, PAGE_MARGIN_RIGHT);
    final PageFormat format = pff.createPageFormat(paper, PageFormat.PORTRAIT);
    report.setPageDefinition(new SimplePageDefinition(format));

    setupWatermark(report);
    setupPageHeader(report);
    //// REPORT GROUP /////////////////////////////////////////////////////////////////////////
View Full Code Here

    if (pageDefinition == null)
    {
      return 0;
    }
    final PageFormat pageFormat = pageDefinition.getPageFormat(0);
    final PageFormatFactory pageFormatFactory = PageFormatFactory.getInstance();
    return pageFormatFactory.getTopBorder(pageFormat.getPaper());
  }
View Full Code Here

    if (pageDefinition == null)
    {
      return 0;
    }
    final PageFormat pageFormat = pageDefinition.getPageFormat(0);
    final PageFormatFactory pageFormatFactory = PageFormatFactory.getInstance();
    return pageFormatFactory.getBottomBorder(pageFormat.getPaper());
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.util.PageFormatFactory

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.