/** * Creates a new demo application. * * @param filename the output filename. * @throws ParseException if the report could not be parsed. */ public StraightToEverything(final String filename) throws ParseException { final URL in = ObjectUtilities.getResource( "org/pentaho/reporting/engine/classic/demo/opensource/opensource.xml", StraightToEverything.class); final MasterReport report = parseReport(in); final TableModel data = new OpenSourceProjects(); report.setDataFactory(new TableDataFactory("default", data)); try { createPDF(report, filename + ".pdf"); createCSV(report, filename + ".csv"); createDirectoryHTML(report, filename + ".html"); createPlainText(report, filename + ".txt"); createRTF(report, filename + ".rtf"); createStreamHTML(report, filename + "-single-file.html"); createXLS(report, filename + ".xls"); createZIPHTML(report, filename + ".zip"); } catch (Exception e) { logger.error("Failed to write report", e); } }
/** * Initializes the simple parser and registers this handler with the parser base module. * * @throws ModuleInitializeException if initializing the module failes. */ public void performInit() throws ModuleInitializeException { final ParserEntityResolver res = ParserEntityResolver.getDefaultResolver(); final URL urlReportDTD = ObjectUtilities.getResource( "org/pentaho/reporting/engine/classic/core/modules/parser/simple/resources/report-085.dtd", SimpleParserModuleInit.class); res.setDTDLocation( SimpleParserModuleInit.PUBLIC_ID_SIMPLE, SimpleParserModuleInit.SYSTEM_ID, urlReportDTD); res.setDTDLocation( SimpleParserModuleInit.PUBLIC_ID_SIMPLE_084, SimpleParserModuleInit.SYSTEM_ID, urlReportDTD); res.setDeprecatedDTDMessage( SimpleParserModuleInit.PUBLIC_ID_SIMPLE_084, "The given public identifier for the XML document is deprecated. " + "Please use the current document type declaration instead: \n" + " <!DOCTYPE report PUBLIC \n" + " \"-//JFreeReport//DTD report definition//EN//simple/version 0.8.5\"\n" + " \"http://jfreereport.sourceforge.net/report-085.dtd\">"); }