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

Attachments

3

blocks

QAlity Plus - Test Management

Checklists

Activity

Lucyna Laska 
February 2, 2017 at 11:27 AM

Okay, so I ignored that issue.

All works. Added a new rights: REPORTS_VIEW and REPORT_TEMPLATES_EDIT. I can generate report in PDF, CSV, XLS, HTML formats. Endpoints require special permission (like described in Acceptance Criteria).

Chongsun Ahn 
February 2, 2017 at 8:34 AM

it was not intentional. I think some underlying changes are being made. In any case, I would prefer to ignore that issue and continue the testing.

Lucyna Laska 
February 2, 2017 at 8:19 AM

thanks for fixing the issue. Now, I can create and update report templates.

Other issues:
1. When I display all reports on UI and report template is not added, the view does not look good.

2. Yesterday, the table with report templates was displayed on UI.


Now it's gone. Was it intentional?

Chongsun Ahn 
February 1, 2017 at 7:01 PM

Thanks for catching that. I have fixed the issue by removing the update endpoint. You can test create and update of report templates using the same endpoint (POST /api/reports/templates/requisitions).

Lucyna Laska 
February 1, 2017 at 10:06 AM
(edited)

I checked all Acceptance Criteria and most of them worked properly. However, I can add report template to database but I can't update my requisition template using PUT "/api/reports/templates/requisitions/id" endpoint (tested using Postman, I did not set headers). I got response form server:

Note: I started preparing the test case for this ticket. (Feel free to check the point 10, where I described the problem, https://openlmis.atlassian.net/wiki/x/8t6eBg)

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Story Points

Original estimate

Time tracking

4h logged1d 6h remaining

Components

Sprint

Fix versions

Priority

Time Assistant

Created January 4, 2017 at 9:09 PM
Updated February 2, 2017 at 1:57 PM
Resolved February 2, 2017 at 11:27 AM