Flux is used often to schedule reports from enterprise reporting systems such as Actuate, Oracle Reports, and Cognos. Flux 8.0.11 now supports the compilation and execution of Jasper Reports, a robust and open source Java reporting system that is available with commercial support options from TIBCO. Sample reports are provided that demonstrate using Jasper to query and report on Flux activities and status. The use of Jasper reports is not limited to Flux data. You can use Jasper Reports to query data through JDBC, TableModels, JavaBeans, XML, Hibernate, CSV, and custom sources. Then publish your reports as PDF, RTF, XML, XLS, CSV, HTML, XHTML, text, DOCX, or OpenOffice.
Installing Sample Reports
Flux provides a set of sample reports for basic reporting. These reports include:
- Failed Runs
- Workflow Audit
- Workflow Average Run Times
- File Activity
- Unzip the following file into the FLUX_HOME/reports/examples directory. Reports.zip
- Copy the JDBC jar file that you use for Flux from the FLUX_HOME/lib directory into the FLUX_HOME/reports/jdbc directory.
- Add and then configure the following entries to your runtime configuration file.
# -- Reporting Component Parameters # RptTrigger defines how often to run the reports # DAYS defines how many days back the report is to be generated against # RptDbType can be generic (for MySql) # RptServerName is the name of the server running the Flux database # RptDbName is the name of the Flux database # RptDriver is the file name of the JDBC driver copied into the JDNC directory in above # RptDbUrl is the URL used to connect to the Flux database # RptUser is the user name used to connect to the Flux database # RptPassword is the password of the user that connects to the Flux database # RptOutputDir is where to place the generated reports. Must be in the webapp directory to be viewable via a browser # RptPattern is the selection pattern to use to pick reports to run # -------------------------------------------------------------------------- /RptTrigger=+60m /DAYS=7 /RptDbType=generic /RptServerName=localhost /RptDbName=flux80 /RptDriver=com.mysql.jdbc.Driver /RptDbURL=jdbc:mysql://localhost:3307/flux80?useSSL=false /RptUser=flux /RptPassword=flux /RptOutputDir=webapp/flux/reports /RptPattern=reports/examples/*.jasper
- Install the following workflow into your Flux repository and submit it for processing. Demo_Run Reports for MySQL (1).ffc
- Expedite the workflow to get it to kickoff immediately. It will take a few minutes to run.
- After the reports run, a link is displayed on the Dashboard providing access to the reports directory.
Making Reports Accessible from Reports Tab within Cockpit
The Reports tab uses runtime configuration to populate a list of available reports for review, an example runtime configuration entry for a list of reports can be seen below:
/RPT-FILEACTIVITY=http://localhost:7186/reports/File_Activity_Past_1_Days.pdf /RPT-RUNS=http://localhost:7186/reports/Runs_MSSQL_Past_1_Days.pdf /RPT-FAILEDRUNS=http://localhost:7186/reports/Failed_Runs_Past_1_Days.pdf /RPT-WORKFLOWAUDIT=http://localhost:7186/reports/Workflow_Audit_Past_1_Days.pdf /RPT-WORKFLOWRUNAVERAGES=http://localhost:7186/reports/Workflow_Run_Averages_Past_1_Days.pdf
This list can be extended if you add additional reports.
Creating or Editing Jasper Reports
To create or edit Jasper reports, download and install JasperSoft's Jasper Studio and design or edit your reports. Once you have a Jasper report definition created (ex: AllAccounts.jrxml), copy it to FLUX_HOME/reports directory. You can optionally compile a Jasper report into a .jasper file using Jasper Reports Studio and and copy it to the FLUX_HOME/reports directory for execution using Flux.
Flux 8.0.11 bundles JasperStarter, a command line launcher for compiling and processing Jasper Reports. You can schedule report generation in your Flux workflows using a Process Action.
Here is a simple command to compile a Jasper report that takes an .jrxml input file and generate a .jasper file:
reports/bin/jasperstarter cp reports/examples/CancelAck.jrxml
Here is the command to process a Jasper report file that takes an xml input data source and xpath to generate a pdf report:
reports/bin/jasperstarter pr reports/examples/CancelAck.jasper -f pdf -t xml --data-file reports/examples/CancelAck.xml --xml-xpath /CancelResponse/CancelResult/ID -o reports/output
Scheduling Jasper Reports using Flux
Since Jasper reports can be executed through the command line, they can also be scheduled within Flux workflows utilizing Process Actions. Variable substitution can be used to pass in runtime variables such as dates and search parameters to drive report generation.
Viewing Generated Reports
Reports can be generated and made visible to users via the embedded Flux web server, or by exposing the reports via configuring the customer-provided web application server (e.g., Tomcat). Reports written to the webapps directory webapps/reports or its subdirectories can be viewed by the URL http://localhost:7186/reports .
An example report is published on Flux website. Reports shown here include Flux status reports such as a daily run summary and a daily failed run summary. The process action contains a command line that appears as follows:
reports/bin/jasperstarter pr reports/examples/DailySummary_Landscape.jasper -t mysql -H localhost -n databasename -u username -p password-f pdf -o /home/flux/flux-8-0-11/webapp/flux/reports