One of the features, that I find quite promising is the ability to easily embed the BIRT engine in custom applications. This can easily be illustrated through a basic unit test. The code below illustrates the key elements required to get started:
/** * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); // The directory where the key plugins are located. System.setProperty("BIRT_HOME", "C:/.../src/main/resources"); } ... /** * @throws Exception Throws exception. */ public void testRunReport() throws Exception { String[] args = { // The format "-f", "html", // The output directory "-o", "C:/.../target", // The locale "-l", "en_US", // The encoding "-e", "UTF-8", // The file to generate the report from. "C:/.../src/test/resources/helloworld.rptdesign" }; ReportRunner.main(args); }The BIRT_HOME directory should contains the following runtime plugins required for the embedded engine:
No comments:
Post a Comment