Built-in Reporting Framework with Jasper Engine / Angular Parameterization

Description

This is to copy/re-build the reporting extension done to Jasper Reports in OpenLMIS v1. However, it has eventually turned into building the basic version of the built-in reporting framework.

The outline of this functionality includes:

This report can use SQL to access each service's schema directly (it does not need to call HTTP/S endpoints to get the data from each service).

Please ask if you have any questions about this ticket.

You can use the sample XML here (https://github.com/OpenLMIS/openlmis-requisition/blob/master/sample/OpenLMISv3-Requisitions.jrxml) to upload a report template.

Acceptance Criteria

  • There should be new rights in the system, REPORTS_VIEW and REPORT_TEMPLATES_EDIT.

  • The demo administrator user should have these rights via a "Reporting Personnel" role.

  • The view requisition report template endpoint (/api/reports/templates/requisitions/id) should now return a selectValues property for each templateParameter.

    • This property should be an array of strings and should reflect the results if the selectSql property was run against the database.

  • There should be a new endpoint (/api/reports/templates/requisitions/id/format) that can generate reports for an existing report template. (Format options are pdf, csv, xls, html)

  • The Reference UI should have a new report tab with a "View reports" link for any user with the REPORTS_VIEW right. (administrator has this right, devadmin or admin do not.)

    • This link goes to the View Reports page.

  • The View Reports page shows all requisition reports in the system.

    • This page is only viewable by someone with the REPORTS_VIEW right.

    • Clicking on the report name goes to the Choose Report Options page for that report.

  • The Choose Report Options page shows options defined in the report.

    • This page is only viewable by someone with the REPORTS_VIEW right.

    • Clicking on a format button (PDF, CSV, XLS, HTML) will open a new tab with the report in that format.

    • The report generated should vary based on the options chosen.

  • Any user without the REPORT_TEMPLATES_EDIT right should not be able to use the following endpoints:

    • POST /api/reports/templates/requisitions

    • PUT /api/reports/templates/requisitions/id

    • DELETE /api/reports/templates/requisitions/id

  • Any user without the REPORTS_VIEW right should not be able to use the following endpoints:

    • GET /api/reports/templates/requisitions

    • GET /api/reports/templates/requisitions/id

    • GET /api/reports/templates/requisitions/id/format

Assignee

Chongsun Ahn

Reporter

Josh Zamor

Labels

Story Points

8

Time tracking

5h

Epic Link

Components

Sprint

None

Fix versions

Priority

Major
Configure