Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Screen Based Reporting

John Woodlock edited this page Jan 15, 2014 · 19 revisions

Screen Based Reporting Introduction

This introduction is for developers. Its purpose is to give a general overview of the functionality of screen based reporting (known as "stretchyreporting" in the code).

It is a pointer to the actual implementation and not necessarily identical to the current code implementation. If you have the current Mifos X code & database you should be easily able to identify the implementation from this introduction.

Functionality

What Is It?

It's one way of making the majority of reporting needs available quickly and cheaply.

User point of view: a person picks a report from a drop down list, inputs any parameters required and clicks Run. The results are displayed in a "generic table" way with generic paging, searching and export functionality. The best way is to see an example of it running:

https://demo.openmf.org/

username: mifos

password: password

From a developer point of view: a person needs a new report, the developer does the sql and adds it to the reporting metadata making it and the generic functions quickly available.

What it isn't?

It's not adhoc reporting as the 'reports' are pre-defined.

It's not meant to address every reporting need. However, it can handle JQuery data table reports, simple charts and Pentaho reports.

There's nothing particularly Microfinance/Mifos X about this reporting functionality except for the authorisation and data scope checks included in the "REST api".

Limitations

There is no real limitation as long as the report isn't 'crazy' big. The report data is a generic resultset which gets passed to the browser from the server. Very big resultsets can impact the user experience. These 'size limits' will vary depending on browser and machine. The expectation is that most useful reports will be small (< 1000 lines) and that is comfortably catered for. It's typically okay to return up to five megabytes of data which amounts to about thirty thousand lines of a pretty wide report... which is, of course, far too much for a person to look through. However, it could be useful to run a big report and then make use of the search results functionality (which runs quickly in the browser)... in which case it's a subjective matter of 'finding out what is an acceptable user experience for you' rather than having hard and fast rules generally applied.

The generic 'full export' functionality provided may also be sensitive to the size of the report but much less so (i.e. you can probably export pretty massive reports to a csv file).

Technical Implementation

There are three parts to the implementation.

Metadata Tables

There are 3 metadata tables that record report details, their parameters and ways of retrieving lists of reports and parameters. They also contain the sql (which can be parameterized) associated with the reports and parameters. The tables are installed as part of the mifos X database installation.

They are:

  • stretchy_report
  • stretchy_report_parameter
  • stretchy_parameter

Some standard reports are set up with the installation data but the metadata can be added to and altered in order to add more parameters, reports, and report categorisations.

REST api

https://demo.openmf.org/api-docs/apiLive.htm#reports for all report related API info.

https://demo.openmf.org/api-docs/apiLive.htm#report_run for API info on running a Mifos X report.

"stretchyreporting" JQuery Plugin

The UI implementation of screen based reporting is encapsulated in the JQuery plugin called "stretchyreporting-V.js" (where V is a version number). stretchyreporting-V.js makes a lot of use of JQuery datatable related functionality and other JQuery functionality/plugins ("i18n" implementation, for example).