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

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


    {
      return;
    }
    final TableModel mdataModel = new ExpressionGroupBugDataSet();
    ExpressionGroupBug bug = new ExpressionGroupBug();
    MasterReport report = TestSystem.loadReport
        ("org/pentaho/reporting/engine/classic/extensions/junit/bugs/resource/ExpressionGroupBug.xml", mdataModel);
    if (report == null)
    {
      logger.error("Failed after parse.");
      return;


  {
    // Boot the system

    // Load the report
    final ReportGenerator generator = ReportGenerator.getInstance();
    final MasterReport report = generator.parseReport
        (ObjectUtilities.getResourceRelative("Prd821.xml", Prd821Test.class));
    // Create the report and export to the supplied output filename
    TestSystem.showPreview(report);
  }

    ClassicEngineBoot.getInstance().start();
  }

  private String exportReport(final MasterReport template, final String encoding) throws Exception
  {
    final MasterReport report = (MasterReport) template.clone();
    report.getReportConfiguration().setConfigProperty
        ("org.pentaho.reporting.engine.classic.core.modules.output.pageable.plaintext.Encoding", encoding);
    final ByteArrayOutputStream bo = new ByteArrayOutputStream();
    PlainTextReportUtil.createPlainText(report, bo, 15, 10);
    final byte[] data = bo.toByteArray();
    return new String(data, encoding);

  public void testExport()
      throws Exception
  {
    final CountryReportXMLDemoHandler demoHandler =
        new CountryReportXMLDemoHandler();
    final MasterReport report = demoHandler.createReport();
    assertNotNull(report);
    final String rdefBeforeFirst = writeReport(report);
    final String utf16 = exportReport(report, "UTF-16");
    final String rdefAfterFirst = writeReport(report);
    assertEquals(rdefBeforeFirst, rdefAfterFirst);

        ("pre276.prpt", Pre276Test.class); //$NON-NLS-1$
  }

  public void testPre276() throws ReportProcessingException, IOException, ReportDefinitionException
  {
    final MasterReport report = parseReport(getReportDefinitionSource());
    final PageFormat pageFormat = report.getPageDefinition().getPageFormat(0);
//    pageFormat.setOrientation(PageFormat.LANDSCAPE);
    report.setPageDefinition(new SimplePageDefinition(pageFormat));
    //TestSystem.showPreview(report);
    PdfReportUtil.createPDF(report, "/tmp/pre276.pdf");

  }

    Object[] names = new Object[]{
            "Capacity", "Cost", "Group", "Location", "Type", "Container", "Date Acquired" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-7
    };

    final TableModel dataModel = new DefaultTableModel(data, names);
    MasterReport report = parseReport(getReportDefinitionSource());
    report.setDataFactory(new TableDataFactory
        ("default", dataModel)); //$NON-NLS-1$
    assertTrue(FunctionalityTestLib.execGraphics2D(report)); }

  public  void testPre123() throws ReportProcessingException, IOException, ReportDefinitionException
  {
    ClassicEngineBoot.getInstance().start();
    String outputFilename = getReportOutputPath() + "/report.html"; //$NON-NLS-1$
    final MasterReport report = parseReport(getReportDefinitionSource());
    HtmlReportUtil.createStreamHTML(report, outputFilename);
    assertTrue(true);
  }

  public static void main(String[] args) throws ReportDefinitionException, ReportProcessingException, IOException
  {
    ClassicEngineBoot.getInstance().start();
    final Pre200Test test = new Pre200Test();
    final MasterReport report = test.parseReport(test.getReportDefinitionSource());

    final InputStream stream = ObjectUtilities.getResourceRelativeAsStream("pre200a.csv", Pre200Test.class);
    CSVTableModelProducer csvTableModelProducer = new CSVTableModelProducer(stream);
    csvTableModelProducer.setColumnNameFirstLine(true);
    final TableModel tableModel = csvTableModelProducer.parse();
    csvTableModelProducer.close();

    final DefaultTableModel model = copyInto(tableModel);
    model.setValueAt(largeText, 3,2);

    report.setDataFactory(new TableDataFactory(report.getQuery(), model));
    TestSystem.showPreview(report);
  }

  }

  public void testSaveEncrypted() throws Exception
  {
    CountryReportSecurityXMLDemoHandler demoHandler = new CountryReportSecurityXMLDemoHandler();
    MasterReport report = demoHandler.createReport();
    byte[] b = createPDF(report);
    PdfReader reader = new PdfReader(b, DocWriter.getISOBytes("Duck"));
    assertTrue(reader.isEncrypted());
  }

  public  void testPre112() throws ReportProcessingException, IOException, ReportDefinitionException
  {
    ClassicEngineBoot.getInstance().start();
    String outputFilename = getReportOutputPath() + "/report-282.html"; //$NON-NLS-1$
    final MasterReport report = parseReport(getReportDefinitionSource());
    report.setDataFactory(new TableDataFactory(report.getQuery(), new DefaultTableModel(10, 10)));
    HtmlReportUtil.createStreamHTML(report, outputFilename);
    assertTrue(true);
  }

TOP

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

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.