Upload
anon677848884
View
38
Download
1
Embed Size (px)
DESCRIPTION
Leveraging Birt
Citation preview
7/17/2019 Leveraging Birt
1/36
2006 by Author; made available under the EPL v1.0 | Date | ther !n"ormation# i" ne$e%%ary
Jason Weathersby
&!'( Evan)eli%t# A$tuate *or+.
Leveraging BIRT Reporting in YourApplications
7/17/2019 Leveraging Birt
2/36
2 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
A)enda
-hat i% &!'( ,$ri+tin) &!'( De+loyin) &!'( 'e+ort% &!'( AP!% Eten%ion Point%
7/17/2019 Leveraging Birt
3/36
2006 by Author; made available under the EPL v1.0 | Date | ther !n"ormation# i" ne$e%%ary
-hat !% &!'(/
7/17/2019 Leveraging Birt
4/36
Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
-hat i% the &!'( Proe$t/
&u%ine%% !ntelli)en$e and 'e+ortin) (ool% ba%ed on E$li+%e !nitially "o$u%ed on embedded re+ortin) "or ava develo+er% (hree initial $om+onent% a% +art o" &!'( +roe$t
Data
Report Engine
Generation
Services
Presentation
Services
Eclipse
ReportDesigner
Report Design Engine
Custom
ReportDesigner
XM
Report
Design
Report
Document
!"M
PD#
XM
Data "rans$orm%
Services
Charting
Services
Custom
Services
12
3
7/17/2019 Leveraging Birt
5/36
3 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( -hat i% available
4 birt&report&$rame'or(&)y*4 +,R" Designer Eclipse Plug&in
4 birt&rcp&report&-esigner&)y*
4 RCP .ersion o$ the +,R" Designer
4 birt&runtime&)y*4 +,R" 'eb application
4 report engine runtime an- e)amples
4 chart engine runtime%
4 birt&charts&)y*4 Stan- alone chart engine plug&ins%
4 Samples
7/17/2019 Leveraging Birt
6/36
6 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( De%i)ner
7/17/2019 Leveraging Birt
7/365 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( ie7%
7/17/2019 Leveraging Birt
8/368 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( Editor
7/17/2019 Leveraging Birt
9/369 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
Pro+erty Editor ie7
7/17/2019 Leveraging Birt
10/3610 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
Previe7in) &!'( 'e+ort%
7/17/2019 Leveraging Birt
11/3611Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( :eneration and 'ender Pi+eline
RptDocument
Report
Document
JavaScript Events
Optional Java Events
RptDesign
XML
Design FileGeneration Phase Presentation Phase
Paginated HML
!S"
Report
Designer
Design
Engine
Report Engine
optionalD&*
7/17/2019 Leveraging Birt
12/3612 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
,$ri+tin)
&!'( ava,$ri+t
&a%ed on illa 'hino
? (hi% i% ,erver ,ide ,$ri+tin) not &ro7%er &a%ed ,$ri+tin)
(7o ty+e% o" ,$ri+tin)
E+re%%ion ,$ri+t% ? ,$ri+t% that return a data value. Available
in the E+re%%ion &uilder.
Element ,$ri+t% @ ava,$ri+t method% that are $alled on
event%. *u%tomi>e the behavior o" the 'e+ort. Available in the
,$ri+t vie7. *ontet o" 7hen the event o$$ur% i% im+ortant.
&oth ty+e% have a$$e%% to the %ame %$ri+tin) obe$t%.
7/17/2019 Leveraging Birt
13/361 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
E+re%%ion ,$ri+tin)
7/17/2019 Leveraging Birt
14/361 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
E+re%%ion ,$ri+tin) ? Lo$ation%
Creating the display value for a report item Creating a computed eld in Data Explorer Specifying a lter condition Specifying a data series for a chart Specifying a map condition Specifying a highlight condition Specifying a group key Specifying a hyperlink Specifying the URI for an image Specifying dynamic data in a text control
7/17/2019 Leveraging Birt
15/3613 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
E+re%%ion ,$ri+t%
'e"eren$e be$t%
Data ,et *olumn%
Parameter alue%
ther 'e+ort Element% *on"i)uration variable%
*on%tant%
B%er?de"ined variable
7/17/2019 Leveraging Birt
16/3616 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
,$ri+tin) =un$tion%
,trin) =un$tion% DateC(ime =un$tion%
7/17/2019 Leveraging Birt
17/3615 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( Event
7/17/2019 Leveraging Birt
18/36
18 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
Element ,$ri+tin)
7/17/2019 Leveraging Birt
19/36
19 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
Element Event andler% u%in) ava
A %et o" Ada+ter% are
%u++lied that allo7 all
event handler% to be
built in ava. (he $la%% i% a +ro+erty
o" the element. *an be debu))ed 7ith
D( u%in) the &!'(
'e+ort *on"i)uration.
7/17/2019 Leveraging Birt
20/36
20 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
De+loyin) &!'(
&!'( 'e+ort -eb A++li$ation
,tandalone -eb
A++li$ation "or runnin) and
vie7in) re+ort%
Delivered in birt?runtime a%
-eb ie7er Eam+le
!n the De%i)ner &!'( u%e%
embedded (om$at "or
+revie7in)# 7here the &irt
ie7er i% a Plu)in
'e+ort En)ine AP! *overed in the AP! %e$tion
o" the +re%entation
J(EE )SEclipse Plugin
RptDesign
XML
Design File
RptDesign
XML
Design File
RptDesign
XML
Design File
RptDocument
Report
Document
RptDocument
Report
Document
RptDocument
Report
Document
*e% "ie+er
ReportEngine
*e% "ie+er
ReportEngine
Java )pplication
ReportEngine
Paginated HML, PDF, O!, -oo.mar.s, !S"
7/17/2019 Leveraging Birt
21/36
21 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( -eb A++li$ation
:enerate re+ort and return a% PD= or (
7/17/2019 Leveraging Birt
22/36
22 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( ie7er
7/17/2019 Leveraging Birt
23/36
2 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( AP!%
'e+ort En)ine AP! @ Load% and ee$ute% de%i)n "ile%. De%i)n En)ine AP! @ *reate% and modi"ie% re+ort de%i)n%. *hartin) AP! @ &uild% and render% $hart%.
7/17/2019 Leveraging Birt
24/36
2 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
'e+ort En)ine AP!
B%ed to inte)rate run?time +ortion o" &!'( into your a++li$ation. B%ed to di%$over and %et +arameter%. 'un a re+ort and out+ut PD=C(
7/17/2019 Leveraging Birt
25/36
23 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
En)ine AP! Engine!on&ig Set con&iguration varia%les such asEngine Home and Log con&iguration
ReportEngine
Generate one or more tas.s
Open Report Design and Documents/ !reate
Engine as./
RptDesign
XML
Design File
RptDesign
XML
Design File
RptDesign
XML
Design File
RptDocument
Report
Document
RptDocument
Report
Document
RptDocument
Report
Document
DataE0tractionas.
DataPrevie+as.
GetParameterDe&initionas.
Runas. Renderas.
Run)ndRenderas.
E0ecute Report Data Sets
Retrieve Parameters and
their properties
Generate HML or PDF Document
Generate Paginated
HML or PDF Document
Retrieve O!, !S", -oo.mar.s etc
7/17/2019 Leveraging Birt
26/36
26 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
'e+ort En)ine AP!
En)ine*on"i) @ ,et o+tion% "or the re+ort en)ine. 'e+ortEn)ine @ B%ed to run one or more 'e+ort (a%
!:etParameterDe"inition(a%
!'unAnd'ender'e+ort(a%
!DataPrevie7(a%
et$
!'e+ort'unnable @ B%ed to o+en a re+ort and +a%% to the
'unAnd'ender ta%. andle to the re+ort de%i)n. (
7/17/2019 Leveraging Birt
27/36
25 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
EngineConfig config = new EngineConfig();//setup configReportEngine engine = new ReportEngine( config );
//open report and create a run taskdesign = engine.openReportDesign( designName );IRunAndRenderask task=engine.createRunAndRenderask( design );
//set image dirs!"#RenderConte$t renderConte$t=new !"#RenderConte$t();
//configure rendering options!"#Render%ption options = new !"#Render%ption();task.setRender%ption(options);
//run reporttask.run();
'e+ort En)ine P%eudo
7/17/2019 Leveraging Birt
28/36
28 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
De%i)n En)ine AP!
4 *reate and modi"y re+ort de%i)n%.
4 *reate and delete re+ort element%.
4 Put re+ort element% into %lot%.4 :et and %et +arameter value%.
4 'etrieve metadata "rom re+ort element%#+ro+ertie% and %lot%.
4 BndoC'edo
4 ,emanti$ *he$% on re+ort de%i)n%.
7/17/2019 Leveraging Birt
29/36
29 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
De%i)n En)ine AP!
Element% @ 'e+ort be$t% %u$h a%
(able# Label# ,tyle et$. Pro+ertie% @
7/17/2019 Leveraging Birt
30/36
0 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
De%i)n En)ine AP!
,e%%ionandle @ B%ed to o+en one or more de%i)n%. 'e+ortDe%i)nandle @ andle to %+e$i"i$ re+ort de%i)n. Element=a$tory @ *reate% ne7 re+ort element% De%i)nElementandle @ andle to $reated element.
:ridandle# 'o7andle# *ellandle# et$
,lotandle @ andle to a ,lot. B%ed to add element to de%i)n# u%in)
add method.
7/17/2019 Leveraging Birt
31/36
1 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&ession!and'e session = DesignEngine.new&ession( nu'' );
// Create a new report design.ReportDesign!and'e design = session.createDesign( );
// setup e'ement factor
E'ementactor factor = design.getE'ementactor( );
// Create a simp'e master pageDesignE'ement!and'e e'ement =
factor.new&imp'e"aster*age( +*age "aster+ );
//,et &'ot!and'e and add e'ementdesign.get"aster*ages( ).add( e'ement );
//&a-e and c'ose report designdesign.sa-eAs( +c/work/temp/a-a*o'is.rptdesign+ );design.c'ose( );
De%i)n En)ine P%eudo
7/17/2019 Leveraging Birt
32/36
2 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( *hart En)ine AP!
4 ,tand Alone *hart :enerator4 Doe% not reFuire the u%e o" the *hart B%er !nter"a$e
4 Doe% not reFuire the u%e o" the 'e+ort En)ine AP!
4 Data i% +rovided in a %tati$ data %tru$ture
@-hen *hart% render in 'e+ort%# 'e+ort En)ine build% %tati$%tru$ture "rom the %+e$i"ied DA data and $reate% the %tati$
%tru$ture
@ *hart% runnin) %tand?alone reFuire a data "eed
4 or).e$li+%e.birt.$hart.data"eed?*u%tom B%er Data ,et
!nter"a$e4 or).e$li+%e.birt.$hart.model.data?!nter"a$e% de"ine% data
%tru$ture
4 ava,$ri+t event% %u++ortaddition o" $u%tom bu%ine%% lo)i$
7/17/2019 Leveraging Birt
33/36
Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
&!'( Eten%ion% Point%
&!'( i% not u%t a tool but a "rame7or. Predominant Eten%ion Point%.
Emitter
DA @ D(P
'e+ort !tem
*hart (y+e%
7/17/2019 Leveraging Birt
34/36
Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
0data&ource oda1ersion=+2.3+dri-erC'ass=+org.ec'ipse.4irt.report.data.oda.5i4ernate.!i4ernateDri-er+
defau'tDisp'aName=+!i4ernate Data &ource+id=+org.ec'ipse.4irt.report.data.oda.5i4ernate+
set5readConte$tC'ass#oader=+fa'se+60/data&ource6
&!'(CD(P Eten%ion Point% Eam+le
7/17/2019 Leveraging Birt
35/36
3 Pre%entation (itle | Pre%entation ,ubtitle | 2006 by Author; made available under the EPL v1.0
-here to Learn
7/17/2019 Leveraging Birt
36/36
2006 b A h d il bl d h EPL 1 0 | D | h ! " i i"
/01