Differenze tra le versioni di "REP - Reporting"

Da itm wiki.
Riga 15: Riga 15:
  
 
<!--
 
<!--
=== BIRT Designer ===
+
=== BIRT Report on itmSUITE® ===
BIRT Designer is a tool (plug-in) integrated to the Eclipse IDE that defines a user friendly interface to create BIRT report. It can be enabled from toolbar on Windows > Open Perspective > Report Design.
+
In itmSUITE®, the steps required to upload and execute BIRT report previously created through the BIRT Designer are following:
BIRT Designer is composed of several Eclipse views to create/configure a report:
+
#Data source configuration
 +
#Load report template (.rptdesign file)
 +
#Create a report instance
 +
#Add report on menu and execute it
  
{| class="wikitable"
+
=== Data Source Configuration ===
! View !! Meaning
+
In itmSUITE, BIRT report data can be extracted only from data sources connected to database:
|-
+
More data source items can be created
|<u>Data Explorer</u> [[File:DataExplorer.png|centre]]||Allows the data management extracted from a specific data source (i.e. database, xlsx file, cvs file, etc.) in order to define data sets and parameters report
 
|-
 
|<u>Navigator</u> [[File:Navigator.png|centre]]||A projects management view. Every project contains one or more report template.
 
|-
 
|<u>Layout</u> [[File:Layout.png|centre]]||Main editor in which user can drag/drops and manages report items to define output report layout
 
|-
 
|<u>Palette</u> [[File:palette.png|centre]]||Contains all graphic report items (label, table, chart, etc...) to add to report layout
 
|-
 
|<u>Property Editor</u> [[File:PropertyEditor.png|centre]]||Menu from which user can configure report items properties
 
|-
 
|<u>Scripting Editor</u> [[File:ScriptEditor.png|centre]]||Editor available for each report items in which insert event drivern JavaScript/Java code
 
|-
 
|<u>Report Preview</u> [[File:Preview.PNG|centre]]||View on which launch a report preview with a limited extracted data
 
|}
 
 
 
 
 
==== Birt Report Creation ====
 
A report can be outlined in a bottom-up 4-levels structure:
 
# <b>Data:</b> data extracted from data source (database, raw file, cvs, etc...)
 
# <b>User Data:</b> extracted data modified by user (e.g., data type changing)
 
# <b>Business Logic:</b> data elaborated according to event driven script (JavaScript/Java code)
 
# <b>Prensentation:</b> data bound to report items (tables, charts, etc...) and shown on report layout
 
 
 
In BIRT Designer all reports can be rappresented as tables, charts, crosstab, textual document or as combination of these items.
 
In this chapter it will be described all steps to create a sample table containing itmSUITE tickets info:
 
 
 
{| class="wikitable"
 
! Id !! Ticket Type !! Ticket Status !! Owner !! Project !! Creation Date
 
|-
 
|1||Incident||Opened||Williams||Project 1||01/01/2017
 
|-
 
|2||Problem||Completed||Michael||Project 2||12/02/2017
 
|-
 
|3||Release||Closed||John||Project 3||23/05/2017
 
|-
 
|}
 
 
 
===== Report Template =====
 
A report template is XML-like file that contains report items, datatsource, dataset and scripting references. It is a .rptdesign exstension file interpreted by Report Engine in order to generate report output.
 
 
 
{| class="wikitable"
 
! Step !! Description
 
|-
 
|<u>1. Project Creation</u>[[File:ProjectCreation.png|centre]]||style="vertical-align:top;"|
 
* Click on '''''File > New > Project''''' on toolbar
 
* Select ''Report Project'' on ''Business Intelligence and Reporting Tools'' section
 
* Tape "My Report" as Project name and click on '''Finish''' button
 
|-
 
|<u>2. Report Template</u>[[File:ReportTemplateCreation.png|centre]]||style="vertical-align:top;"|
 
* Click on '''''File > New > Report''''' on toolbar
 
* Select "My Report" Project created on previous steps
 
* Tape "MyTickets.rpdesign" as report template name and click on '''Next''' button
 
* Create a blank report. Other default models: ''Simple Listing'', ''Dual Column Listing'', ''Grouped Listing'', ''Chart Listing''
 
* Click on '''Finish''' button. Report template file has been created in workspace
 
|-
 
|}
 
 
 
===== Data Source =====
 
In BIRT Designer, data can be extracted from various data sources such as database, flat file, csv file, etc. The detailed steps to create a data source bound to a database are explained below:
 
 
 
{|class="wikitable"
 
! Step !! Description
 
|-
 
|<u>3. Data Source Creation</u>[[File:DataSourceCreation.png|centre]]||style="vertical-align:top;"|
 
*Select ''Data Source'' item from '''''Data Explorer''''' view
 
*Click on '''New Data Source''' from context menu
 
*Select ''JDBC Data Source'' and insert a data source name (e.g., "MyTicketSource")
 
|-
 
|<u>4. Database Connection</u>[[File:DatabaseConnection.png|centre]]||style="vertical-align:top;"|
 
*Click on '''Manage Driver…''' and select a jdbc driver (e.g., "sqljdbc4.jar" file for [https://www.microsoft.com/en-us/download/details.aspx?id=11774, Microsoft SQL Server])
 
*Fill following fields, such as:
 
**<u>Driver Class</u>: "com.microsoft.sqlserver.jdbc.SQLServerDriver (v4.0)" (for MS SQL Server)
 
**<u>Database URL</u>: "jdbc:sqlserver://ip_address:db_port;DatabaseName=Nome_DB"
 
**<u>User Name</u>: sql username
 
**<u>Password</u>: sql password
 
*Click on '''Test Connection''' to check connection to database and then on '''Finish'''
 
|-
 
|}
 
 
 
 
 
===== Data Set =====
 
In BIRT Designer data set are items that contain data extracted from data source (e.g., by means sql query) in order to populate report items (tables, charts, parameters, etc...) whom they are bound.
 
 
 
{| class="wikitable"
 
! Step !! Description
 
|-
 
|<u>5. Data Set Creation</u>[[File:DataSetCreation.png|centre]]||style="vertical-align:top;"|
 
* Select ''Data Set'' item from '''''Data Explorer''''' view
 
* Click on '''New Data Sets''' from context menu
 
* Select "SQL Select Query" and insert Data Set name. Click on '''Next'''
 
|-
 
|<u>6. Query Configuration</u>[[File:QueryConfiguration.png|centre]]||style="vertical-align:top;"|
 
* Insert sql query statements in '''''Query Text''''' form and click on '''Finish'''
 
* In Data Set editor following options are available :
 
** '''''Output Columns:''''' shows column name defined in query
 
** '''''Preview Results:''''' shows preview query result
 
** '''''Parameters:''''' defines parameters for BIRT parametric query
 
** '''''Filters:''''' filters data to include in Data Set
 
|-
 
|}
 
 
 
In sample ticket info report four data set will be created:
 
 
 
{| class="wikitable"
 
! Data Set !! SQL query !! Description
 
|-
 
|Owner
 
|<syntaxhighlight lang="sql">
 
select distinct owner
 
from TICKET
 
</syntaxhighlight>
 
|Extracts ''owner'' name from the TICKET table
 
|-
 
|Project
 
|<syntaxhighlight lang="sql">
 
select name
 
from PRJ
 
</syntaxhighlight>
 
|Extracts ''project'' name from the PRJ table
 
|-
 
|Ticket Type
 
|<syntaxhighlight lang="sql">
 
select name
 
from TICKETTYPE
 
</syntaxhighlight>
 
|Extracts ''ticket type'' name from the TICKETTYPE table
 
|-
 
|Ticket info
 
|<syntaxhighlight lang="sql">
 
select
 
t.ID
 
,tp.name as TICKET_TYPE
 
,w.name as TICKET_STATUS
 
,t.owner as OWNER
 
,p.name as PROJECT
 
,t.creationDate as CREATION_DATE
 
from TICKET t
 
inner join TICKETTYPE tp on (tp.id = t.TICKETTYPE_ID)
 
inner join WORKFLOWTICKETOPSTATUS w on (w.id = t.WORKFLOW_TICKET_OPSTATUS_ID)
 
inner join PRJ p on (p.id = t.PROJECT_ID)
 
where t.creationDate >= ? and t.creationDate <= ?
 
</syntaxhighlight>
 
|Parametric query that extracts ticket info in order to populate report table
 
|-
 
|}
 
 
 
===== Parameters =====
 
 
 
===== Report Layout =====
 
 
-->
 
-->

Versione delle 15:35, 13 giu 2018

REP is an optional itmSUITE® module that defines functionality to manage and excute reports created by Eclipse BIRT Designer tool.
It allows to load one or more report templates (BIRT.rptdesign file) and to create and to execute report instances through the BIRT Viewer integrated on itmSUITE®.

BIRT Architecture

BIRT (Business Intelligence Reporting Tool)is an open source tool installed as Eclipse IDE plug-in for report developing. It has origin from collaboration between Actuate (along with IBM) and Eclipse.org open source community.
BIRT is a Java based tool that allows to extract data from many data source types for report generation in several output format (pdf, xlsx, docx, etc.).

Birt Architecture

BIRT architecture includes two main components:

  1. Report Designer: a UI component to create report template (.rptdesign file)
  2. Report Engine: runtime component for report rendering

The Design Engine generates a .rptdesign file(in XML format) structured according to configurations applied by user (by BIRT Designer) and the Report Engine, through BIRT Viewer, parses it and renders it as report in html (or other formats).