THE BIRT COMPANY THE BIRT COMPANY THE BIRT
THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY THE BIRT COMPANY 1 Actuate Corporation © 2010 THE BIRT COMPANY THE BIRT
Creating Data Driven Web Apps with BIRT Michael Williams BIRT Evangelist, Actuate, BIRT Exchange 2 Actuate Corporation © 2010
Agenda • Introduction • Designing Reports • Designer • APIs • What Now? • BIRT Viewer • Report Engine (Java) • i. Hub • Plug In 2 BIRT – Spring 2013 • Questions 3 Actuate Corporation © 2009
Introduction 4 Actuate Corporation © 2009
Actuate Launches the BIRT Project Actuate proposed and started BIRT Business Intelligence and Reporting Tools Project … a top-level Eclipse project Actuate Joins Eclipse Foundation as Strategic Developer and Board Member Adds BI and Reporting as Open Source Project Professional open source Primary development resources funded by Actuate Contributions from many sources IBM, Innovent Solutions and community 5 Actuate Corporation © 2010 AUGUST 2004
Business Intelligence and Reporting Tools A New Generation of Data Visualization Technology • Makes all data-driven content development easy • Modern, web-page design metaphor • Open and standards-based • Flexible with rich programmatic control • Full support for libraries and reuse • Foundation for a range of solutions Simplicity that makes simple layouts easy 6 Actuate Corporation © 2010 Power BIRT to create very complex layouts
Designing Reports 7 Actuate Corporation © 2009
Eclipse Based Designer 8 Actuate Corporation © 2009
BIRT Example Key Capabilities Very Simple to Very Complex Layouts • Listings, cross-tab, dashboard, pixelperfect, charts … • Grouping, advanced aggregations, subtotals, calculations • Multi-section and sub-reports • Conditional sections and logic • Full programmatic control/scripting • Embedded images… Comprehensive Data Access • SQL databases, Web Services, Flat Files, XML, scripted data sources … • Multiple data sources in one design… Re-use and Developer Productivity • Library support for publishing and sharing components • Leverages common standards (SQL, HTML, Java. Script, Java, XML) • Cascading Style Sheets • Built-in debugger… Interactivity and Linking • Data driven hyperlinks • Drill-through charts and graphics… Multiple Usage and Productivity Aids • Graphical layout and design Output Formats • Query & metadata editors • HTML, PDF, Excel, Word, Power. Point… • Formatting Builder • Internationalization of labels and text • Grouping Builder • Bi-Directional language display • Customizable cheat sheets and templates… 9 Actuate Corporation © 2010
Designing Reports Quick Designer Tour 10 Actuate Corporation © 2009
APIs Design Engine API (DE API): Used to create custom reports, create custom report designer tools, or to explore or modify BIRT report designs. It can also be called within BIRT script to modify the report at runtime. The BIRT Designer is built using this API. Chart Engine API (CE API): Can be used to create and render charts separately from BIRT. It can also be called in the chart script to modify a chart at runtime. Data Engine API: Used to define Data Sources and Data Sets, and to prepare an IQuery. Definition. It can also be used in script to process a Data Set’s data at runtime. 11 Actuate Corporation © 2009
What Now? 12 Actuate Corporation © 2009
Multiple Deployment Options BIRT Design BIRT Engine and APIs BIRT on. Demand BIRT i. Hub 13 Actuate Corporation © 2009
BIRT Web Viewer Copy Web. Viewer. Example from the runtime download to the application server and rename it “birt” 14 Actuate Corporation © 2009
BIRT Web Viewer URLs With viewer toolbar, pagination, etc. : http: //localhost: 8080/birt/frameset? __report=report. Name. rptdesign As a straight HTML output: http: //localhost: 8080/birt/run? __report=report. Name. rptdesign Other servlet mappings: preview, document, output, extract URL parameters include: id title showtitle toolbar navigationbar locale format report document parameterpagerange fittopage svg isnull islocale masterpage resource. Folder bookmark rtl page overwrite 15 Actuate Corporation © 2009
BIRT Web Viewer URLs Output to PDF: http: //localhost: 8080/birt/frameset? __report=report. Name. rptdesign&__format =pdf To display a single report item as a reportlet: http: //localhost: 8080/birt/run? __report=report. Name. rptdesign&__bookmark= my. Table&__isreportlet=true 16 Actuate Corporation © 2009
BIRT Viewer Tag Library Example JSP to embed viewer: <%@ page language="java" content. Type="text/html; charset=ISO-8859 -1" page. Encoding="ISO-8859 -1"%> <%@ taglib uri="/birt. tld" prefix="birt" %> <!DOCTYPE html PUBLIC "-//W 3 C//DTD HTML 4. 01 Transitional//EN" "http: //www. w 3. org/TR/html 4/loose. dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859 -1"> <title>My Report - JSP</title> </head> <body> <birt: viewer id="birt. Viewer" report. Design=“report. Namerptdesign" pattern="frameset" height="450" width="700" format="html"></birt: viewer> </body> </html> http: //localhost: 8080/birt/dashboard. jsp 17 Actuate Corporation © 2009
BIRT Viewer Tag Library <%@ page language="java" content. Type="text/html; charset=ISO-8859 -1" page. Encoding="ISO-8859 -1"%> <%@ taglib uri="/birt. tld" prefix="birt" %> <!DOCTYPE html PUBLIC "-//W 3 C//DTD HTML 4. 01 Transitional//EN" "http: //www. w 3. org/TR/html 4/loose. dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859 -1"> </head> <style type="text/css">. class 1 { background-color: #ff 0000; color: #ffffff; } </style> <body> Parameter Page 1 <birt: parameter. Page id="report 1" name="page 1" report. Design="cascade_report. rptdesign" is. Custom="true" pattern="frameset"> Cascading Parameter 1: <birt: param. Def id="5" name="Country" /> Cascading Parameter 2: <birt: param. Def id="6" name="City"/> Cascading Parameter 3: <birt: param. Def id="7" name="Customer" css. Class="class 1"/> <input type="submit" name="submit" value="Sumbit form"/> </birt: parameter. Page> </body> </html> http: //localhost: 8080/birt/cascade_report. jsp 18 Actuate Corporation © 2009
Report Engine API (RE API) static void execute. Report() throws Engine. Exception { IReport. Engine engine=null; Engine. Config config = null; try{ config = new Engine. Config( ); config. set. Log. Config("C: \BIRT_231\logs", java. util. logging. Level. FINEST); Platform. startup( config ); IReport. Engine. Factory factory = (IReport. Engine. Factory) Platform . create. Factory. Object( IReport. Engine. Factory. EXTENSION_REPORT_ ENGINE_FACTORY ); engine = factory. create. Report. Engine( config ); IReport. Runnable design = null; design = engine. open. Report. Design("C: \BIRT_231\designs\param . rptdesign"); IRun. And. Render. Task task = engine. create. Run. And. Render. Task(design); task. set. Parameter. Value("ord. Param", (new Integer(10101))); task. validate. Parameters(); PDFRender. Option options = new PDFRender. Option(); options. set. Output. File. Name("my_report. pdf"); options. set. Output. Format("pdf"); task. set. Render. Option(options); task. run(); task. close(); engine. destroy(); }catch( Exception ex){ ex. print. Stack. Trace(); } finally { Platform. shutdown( ); } 19 Actuate Corporation © 2009
RE API with JSF public class birt 2 jsf { String execute. Report(String param) throws Engine. Exception { IReport. Engine engine=null; Engine. Config config = null; try{ config = new Engine. Config( ); config. set. Log. Config("/logs", java. util. logging. Level. FINEST); Platform. startup( config ); IReport. Engine. Factory factory = (IReport. Engine. Factory) Platform. create. Factory. Object( IReport. Engine. Factory. EXTENSION_REPORT_ENGINE_FACTORY ); engine = factory. create. Report. Engine( config ); IReport. Runnable design = null; design = engine. open. Report. Design("E: /apache-tomcat-6. 0. 36/webapps/JSF_2/test. rptdesign"); IRun. And. Render. Task task = engine. create. Run. And. Render. Task(design); task. set. Parameter. Value("Country", param); task. validate. Parameters(); HTMLRender. Option options = new HTMLRender. Option(); Byte. Array. Output. Stream outs = new Byte. Array. Output. Stream(); options. set. Output. Stream(outs); options. set. Image. Handler(new HTMLServer. Image. Handler()); options. set. Base. Image. URL("images"); options. set. Image. Directory("E: /apache-tomcat-6. 0. 36/webapps/JSF_2/images"); options. set. Embeddable(true); options. set. Output. Format("html"); task. set. Render. Option(options); String output; task. run(); output = outs. to. String(); task. close(); engine. destroy(); return output; }catch( Exception ex){ ex. print. Stack. Trace(); return "Error"; } finally { Platform. shutdown( ); Registry. Provider. Factory. release. Default(); } } } 20 Actuate Corporation © 2009
RE API with JSF @Managed. Bean(name="birt. Bean") @Session. Scoped public class Birt. Bean implements Serializable { private static final long serial. Version. UID = 1 L; private String name; public String get. Report() { birt 2 jsf report = new birt 2 jsf( ); String report. HTML = null; try { report. HTML = report. execute. Report(name); } catch (Engine. Exception e) { e. print. Stack. Trace(); } return report. HTML; } public String get. Name() { return name; } public void set. Name(String name) { this. name = name; } } 21 Actuate Corporation © 2009
RE API with JSF <? xml version="1. 0" encoding="UTF-8"? ><!DOCTYPE html PUBLIC "-//W 3 C//DTD XHTML 1. 0 Transitional//EN" "http: //www. w 3. org/TR/xhtml 1/DTD/xhtml 1 -transitional. dtd"> <html xmlns="http: //www. w 3. org/1999/xhtml" xmlns: f="http: //java. sun. com/jsf/core" xmlns: h="http: //java. sun. com/jsf/html"> <h: head> <title>BIRT JSF 2. 0 Example</title> </h: head> <h: body> <h 3>Enter Country</h 3> <h: form> <h: input. Text value="#{birt. Bean. name}"> </h: input. Text> <h: command. Button value="View Report" action="page-a"> </h: command. Button> <h: output. Text value="#{birt. Bean. report}" escape="false"/> </h: form> </h: body></html> http: //localhost: 8080/JSF_2/page-a. jsf 22 Actuate Corporation © 2009
i. Hub and JSAPI <html> <head> <script type="text/javascript" language="Java. Script" src="http: //localhost: 8900/Actuate. Java. Component/jsapi"></script> </head> <body onload="init(); "> <h 1>Simple Viewer</h 1> <div id="my. Div. Container" style="border-width: 1 px; border-style: solid; "></div> <script type="text/javascript" language="Java. Script"> var my. Viewer; function init(){ actuate. load("viewer"); actuate. initialize( "http: //localhost: 8900/iportal/", null, create. Viewer ); } function create. Viewer(){ my. Viewer = new actuate. Viewer( "my. Div. Container" ); my. Viewer. set. Report. Name("/Mashup/Quick. Report. rptdesign" ); my. Viewer. submit(); } </script> </body> </html> 23 Actuate Corporation © 2009
Plug In 2 BIRT – Spring 2013 Contest runs from March 28, 2013 to April 30, 2013 Plug-In Categories Open Data Access (ODA) Drivers Output Emitters Report Item Extensions Chart Extensions New i. Pad for Top 3 Plug-Ins! Visit BIRT Exchange for full contest details 24 Actuate Corporation © 2009
Questions? 25 Actuate Corporation © 2009
Downloads and Getting Started BIRT Exchange Community Site Centralized hub for BIRT developers • Access demos, tutorials, tips and techniques, documentation… • Enables developers to be more productive and build applications faster • Marketplace for applications Explore • Search/sort • Rate, comment • Forums Download • Documentation • Software • Examples www. birt-exchange. org 26 Actuate Corporation © 2010 Contribute • BIRT designs, code • Technical tips • Applications
- Slides: 26