Skip to content

vinayvenu/possible-reports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Possible Reports (Archived)

Report repository for SEARCH specific reports (using Jasper). You can access these reports in Bahmni at the following URL: http://<IP>:8080/jasperserver

Folder Structure

  • conf: DB Connection settings.
  • db: Liquibase migration file for report specific lookup tables, etc.
  • jasperRepository: Jasper folder which contains all the reports (exported using the sample-export.sh script).
  • jrxml : Shortcuts for each report (generated using the create_symlinks.sh script).
  • lib : Jars for mysql and liquibase.
  • script : Wrapper scripts over jasper scripts.

Working with Jasper

Note: SEARCH Reports only works with iReport 4.7.1. Do not use a newer version of iReport or Jaspersoft Studio.

We are using Jasper Server deployed as a WAR in the Webapps folder of Tomcat. Jasper internally uses a DB to store all configuration, report templates, meta-data, etc and provides with tooling to export / import the reports. In Bahmni, we use MySQL Db as backend for Jasper.

When we create a report in Jasper using the JasperSoft iReport 4.7.1 tool, we upload the report to the Jasper Reporting Server from iReport. Once we are satisfied with the report, then using the export command, we dump all reports from the Jasper server, and check them into the jasperRepository folder.

The build process imports the contents of the jasperRepository folder into the machine on which deployment is happening.

The main commands used in this process are:

Puppet commands

  • ./scripts/run-puppet-module.sh jasperserver : Run this command from bahmni-environment to create the jasperserver war file in tomcat. This will create a fresh jasper server instance with no reports or data. This is typically a first-time setup command.
  • ./scripts/run-puppet-module.sh bahmni-jasperreports : Run this command from bahmni-environment to deploy the reports from jasperRepository into jasperserver war file. This command will pull the reports from GITHUB. This command will typically need to be run on each deployment and internally uses the js-import.sh command of Jasper to populate the Jasper DB.

Local Scripts

  • EXPORT: ./scripts/sample-export.sh : Wrapper over the js-export.sh Jasper command for exporting the whole Japser Database into the jasperRepository folder. This command will overwrite the current jasperRepository folder with appropriate files.
  • IMPORT: ./scripts/deploy.sh : Wrapper over the js-import.sh and db_deploy.sh Jasper command for importing all data and reports from jasperRepository folder into jasperserver database. Exact command /deploy.sh -j /usr/local/jasperreports-server-cp-5.0.0-bin -p ../conf/reports_default.properties
  • LIQUIBASE: ./scripts/db_deploy.sh : For running liquibase migrations.
  • SYM LINKS: ./scripts/create_symlinks.sh : For each report in jasperRepository, this command creats a shortcut file in jrxml folder.

Process to follow to publish a report from QA Server

Once you are OK with a report on the QA box, to publish it into GITHUB, follow these steps:

  1. Log onto the box via SSH.
  2. Go to search-reports folder on the machine.
  3. Perform a git pull --rebase to get latest.
  4. Go to the scripts folder and execute the command: ./sample_export.sh /usr/local/jasperreports-server-cp-5.0.0-bin/buildomatic/
  5. Perform a git status. We need to commit 3 files from this list. See this commit to understand which files need to be added (one .folder.xml, and 2 new ones).
  6. Once committed, perform a git reset --hard to undo all other changes.
  7. Then, create a symlink jrxml file for future iReport editing using the command (from scripts folder): create_symlinks.sh.
  8. Commit this symlink file. and
  9. Push the 2 commits to the repository on Github.
  10. Trigger the CI pipeline to ensure that everything is OK with reports repository.

Fresh Jasper (For Implementation)

The Tag Baseline_Jasper can be extracted from this repo to get a Fresh Japser instance for starting out with a new implementation.

Releases

No releases published

Packages

No packages published

Languages