Report repository for SEARCH specific reports (using Jasper). You can access these reports in Bahmni at the following URL: http://<IP>:8080/jasperserver
- 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.
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:
./scripts/run-puppet-module.sh jasperserver
: Run this command from bahmni-environment to create thejasperserver
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 intojasperserver
war file. This command will pull the reports from GITHUB. This command will typically need to be run on each deployment and internally uses thejs-import.sh
command of Jasper to populate the Jasper DB.
- EXPORT:
./scripts/sample-export.sh
: Wrapper over thejs-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 thejs-import.sh
anddb_deploy.sh
Jasper command for importing all data and reports from jasperRepository folder intojasperserver
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.
Once you are OK with a report on the QA box, to publish it into GITHUB, follow these steps:
- Log onto the box via SSH.
- Go to search-reports folder on the machine.
- Perform a
git pull --rebase
to get latest. - Go to the scripts folder and execute the command:
./sample_export.sh /usr/local/jasperreports-server-cp-5.0.0-bin/buildomatic/
- 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). - Once committed, perform a
git reset --hard
to undo all other changes. - Then, create a symlink jrxml file for future iReport editing using the command (from scripts folder):
create_symlinks.sh
. - Commit this symlink file. and
- Push the 2 commits to the repository on Github.
- Trigger the CI pipeline to ensure that everything is OK with reports repository.
The Tag Baseline_Jasper
can be extracted from this repo to get a Fresh Japser instance for starting out with a new implementation.