コード例 #1
0
 @Test
 public void testComplexCrosstab() throws ResourceException, ReportProcessingException {
   final MasterReport report = DebugReportRunner.parseGoldenSampleReport("Prd-4523.prpt");
   report
       .getReportConfiguration()
       .setConfigProperty(
           "org.pentaho.reporting.engine.classic.core.modules.output.table.base.FailOnCellConflicts",
           "true");
   HtmlReportUtil.createStreamHTML(report, new NullOutputStream());
 }
コード例 #2
0
  /**
   * The starting point for the application.
   *
   * @param args ignored.
   */
  public static void main(final String[] args) {
    ClassicEngineBoot.getInstance().start();
    final ReportGenerator gen = ReportGenerator.getInstance();
    final URL reportURL =
        ObjectUtilities.getResourceRelative(REFERENCE_REPORT, StyleKeyReferenceGenerator.class);
    if (reportURL == null) {
      System.err.println("The report was not found in the classpath"); // $NON-NLS-1$
      System.err.println("File: " + REFERENCE_REPORT); // $NON-NLS-1$
      System.exit(1);
      return;
    }

    final MasterReport report;
    try {
      report = gen.parseReport(reportURL);
    } catch (Exception e) {
      System.err.println("The report could not be parsed."); // $NON-NLS-1$
      System.err.println("File: " + REFERENCE_REPORT); // $NON-NLS-1$
      e.printStackTrace(System.err);
      System.exit(1);
      return;
    }
    report.setDataFactory(new TableDataFactory("default", createData())); // $NON-NLS-1$
    try {
      HtmlReportUtil.createStreamHTML(
          report,
          System.getProperty("user.home") // $NON-NLS-1$
              + "/stylekey-reference.html"); //$NON-NLS-1$
      PdfReportUtil.createPDF(
          report,
          System.getProperty("user.home") // $NON-NLS-1$
              + "/stylekey-reference.pdf"); //$NON-NLS-1$
    } catch (Exception e) {
      System.err.println("The report processing failed."); // $NON-NLS-1$
      System.err.println("File: " + REFERENCE_REPORT); // $NON-NLS-1$
      e.printStackTrace(System.err);
      System.exit(1);
    }
  }
コード例 #3
0
 /**
  * Saves a report in a ZIP file. The zip file contains a HTML document.
  *
  * @param report the report.
  * @param filename target file name.
  * @throws Exception if an error occurs.
  */
 public static void createZIPHTML(final MasterReport report, final String filename)
     throws Exception {
   HtmlReportUtil.createZIPHTML(report, filename);
 }