Reporting

Reporting for Mifos is currently powered by Pentaho through the Mifos Business Intelligence Suite (BI). Mifos BI contains a large set of standard reports and a data warehouse to provide for convenience and ease of use when building new reports. BIRT was our previous reporting solution and a small number of our standard reports are still written in BIRT and are directly embedded in the Mifos application. 

Mifos BI requires a separate installation which can be done on Windows or Linux.  This section provides links to documentation on accessing standard reports in Mifos, understanding the Mifos data model, building new reports, and deprecated documentation on reporting tools like BIRT and Jasper.  

0
Your rating: None

Built-in Standard Reports

Standard Reports in Mifos

The overall reporting and business intelligence solution for Mifos has been transitioned from BIRT to Pentaho. Until the transition is complete, standard reports will be accessed in two different manners via Mifos. 

 

  • Embedded Reports (BIRT): Mifos contains 5 standard reports which are directly accessible via the Reports Tab.  See BIRT Reports in Mifos for an overview of these. 
  • Mifos Business Intelligence Suite Reports (Pentaho): Mifos Business Intelligence Suite contains an additional 20 standard reports built in Pentaho.  To view these reports, you must install Mifos Business Intelligence Suite for either Windows or Linux. You can then access any of the reports via a web browser. Please visit the Mifos Business Intelligence Suite page to download it, view  samples of each report, access installation documentation, and more.  

Mifos BI reports have not been directly embedded into the Mifos UI yet; they currently must be accessed by logging into Pentaho via a separate window/tab in your internet browser.  We are working on a smoother more integrated user experience for accessing the Mifos BI reports built in Pentaho.  The explanation below regarding built-in Mifos report templates only applies to the limited number of embedded reports still written in BIRT. 

 

Built-in Mifos Report Templates 

While our overall reporting tool has been replaced by Pentaho, a number of standard reports are still BIRT-based. This explanation is relevant to those reports but will not be used for any reports going forward. Users can use the embedded BIRT report templates as is, they can edit templates to suit their own needs by changing the layout or adding/removing fields, or they can build their own reports. Report templates are grouped into categories that can be defined and edited by users with the appropriate permissions. A user can attach permissions to a report to specify who can view, edit, and categorize the report.

Generate a report. A user generates a report by selecting it from the Reports tab. The data included in the report is based on the user’s data scope and the parameters entered when generating the report. The report is displayed in PDF format, which can be downloaded. Accessing and using these reports does not require that BIRT (Business Intelligence and Reporting Tools) be installed. More information regarding the generation of each built-in Mifos report is provided later in this section.

Edit a report category. Mifos ships with a standard set of report categories that are used to organize report templates. These can be viewed, edited, deleted, and added to from the Admin tab. Report templates are assigned to categories and displayed under these categories on the Report tab.

Customizing Built-in Reports

MFIs can customize reports that ship with Mifos in the following ways:

  • Add/remove data fields displayed on reports
  • Add permanent field-level filters to the reports. For example, exclude a particular loan product from all loan portfolio calculations
  • Add filters to an existing field. For example, for a data field that displays the total outstanding loan amount, an MFI can add a filter so that the field displays the total outstanding loan amount for women clients. Users can also use custom fields as a way to filter information in a report.
  • Change the report layout by, for example, switching from a horizontal to vertical orientation or adding organizational logos or changing the report title.
0
Your rating: None

Building your own Reports

Documentation on building custom user-specific reports for Pentaho will be made available soon.  See our BIRT Reports in Mifos section for documentation on building custom BIRT reports

0
Your rating: None

Understanding Mifos Data Model

Tips on navigating Mifos data schema and database to run MySQL queries and build new reports.

The Mifos Data Model can be tricky to understand.  Understanding the Mifos data model including the Mifos production database schema, Mifos Data Warehouse schema and where information lies in what tables is essential to building reports and extracting data.

Linked to from this page are several resources to help you identify where to look for certain client and portfolio information that is stored in Mifos' MySQL Database.

Mifos Data Schema

A visualization of the tables in the Mifos database can be accessed from this Schemaspy output of the database

SQL Query Repository

On our developer wiki on MifosForge, we've created a repository of MySQL queries that are helpful in building out new custom reports in Pentaho, extracting data needed by management and Mifos users, and pulling out information from the Mifos database. Sample queries include number of loans outstanding, branchwise number of loans disbursed and amount disbured during period, etc.

0
Your rating: None

BIRT Reports

0
Your rating: None

BIRT Training Guide

A BIRT training session put together for ENDA in June, 2008

  1. Database Exercises - An introduction to creating reports in BIRT, starting with writing SQL.  It also describes some of the key Mifos tables - customer, account, loan account, and loan schedule.
  2. Building the Approval Form in BIRT - This presentation explains how to create the query for a basic report called the Approval Form, then how to build the report in BIRT. See related files Approval Form with Cascading Report Parameters & Approval Form with Hidden and Cascading Report Parameters
  3. Aggregation Training - Explains how to add grouping and aggregation functions to a BIRT report.  Sample Report: Aggregation Demonstration Report
  4. Charts Training - Introduces creating charts in BIRT.  Sample Report: Chart Demonstration Report
0
Your rating: None

Building Reports in BIRT

Installing BIRT

To customize the standard reports provided by default with Mifos or to create your own reports, you will need to download and install version 2.1.2 of the BIRT RCP (Rich Client Platform) Report Designer from Eclipse. The RCP version is required because it produces reports in the version (3.2.6) supported by the BIRT Report Viewer provided with Mifos. It also simplifies the Eclipse user interface so that only essential screens and options are presented.

To install BIRT:

  1. Download, free of charge, the BIRT RCP Report Designer version 2.1.2.
  2. Accept the default installation location (for example, C:\Program Files\birt-rcp).

Creating your own Reports

Designing your Reports

Designing your own report starts with planning it on paper or in a spreadsheet application like Excel. See the following sample: report designed in Excel.

Data Extraction and Mifos

If you are creating your own report, the data in the report can be extracted one of two ways:

  • Using an SQL query (recommended): In this approach, you create a new report in BIRT that includes an SQL query that you provide. When the report is generated, data is extracted over a database connection. The topics below describe this approach and assume a working knowledge of SQL.
  • Using a direct software connection: You can also use a direct software connection (or, in BIRT terminology, a scripted data source) to extract data. In this approach, BIRT interacts with the business logic layer in Mifos' Java code. Java knowledge is required. For more information, see Creating A BIRT Report Using A Scripted DataSource.

For a technical overview on how BIRT interacts with Mifos, see Current Reports Architecture.

Extracting Data Using SQL

To create a custom report that uses SQL to extract data, use the procedure below. For help with steps you perform in BIRT, see the following in the BIRT RCP Designer online help: BIRT Report Developer Guide > Field Guide to BIRT > Learning the Basics > Tutorial 1: Building a Simple Listing Report.

  1. Open a new report in BIRT RCP Designer.
  2. Create a data source in BIRT, using the following values in the New Data Source wizard:
  • Data Source Name: Mifos Data Source
  • Driver Class: com.mysql.jdbc.Driver (what to do if this driver isn't listed)
  • Database URL: jdbc:mysql://localhost:3306/mifos (if you're creating reports locally)
  • User Name: root
  • Password: the default is mysql
  • JNDI URL: leave blank
  1. In the Query tool of your choice, write the SQL query. See SQL Query Tips for more information.
  2. In BIRT, create a data set. In the Query window, paste in the query you wrote in step 3.
  3. Create one or more input parameters in BIRT. See About Input Parameters below for more information.

If com.mysql.jdbc.Driver isn't listed

If com.mysql.jdbc.Driver isn't listed, download it from http://dev.mysql.com/downloads/connector/j/5.0.html and place the file mysql-connector-java-5.1.5.bin.jar in ...\mifos\build\src_pkg\WEB-INF\platform\plugins\ where ... is the path to your Mifos working copy. For example, on Windows: C:\subversion\projects\mifos-trunk\mifos\build\src_pkg\WEB-INF\platform\plugins, on Mac OS X or GNU/Linux: /home/user/svn/mifos-trunk/mifos/build/src_pkg/WEB-INF/platform/plugins/.

SQL Query Tips

As you write your query, keep the following in mind:

  • Look at the Mifos database: Using the sample report you designed in Excel and an application like MySQL Query Browser, view the tables and their columns in the Mifos database to determine what you need. The automatically generated Mifos schema diagrams are another resource. Pick the database link that corresponds to your Mifos database version. To determine your Mifos database version, run the following command on your Mifos database: select * from database_version
  • Sequence is important: Put your SQL query fields in the same order in which you want them to appear in your report.
  • Hash sign not recognized: BIRT does not recognize the hash sign (#). To include comments, use the following characters: /* comment */
  • Finish your query: Make sure your query is final before you paste it into the data set you'll create in step 4.

About Input Parameters

An input parameter is a value entered by the user. A series of input parameters, called cascading parameters, can dynamically filter, or constrain, the next option's possible values. The Collection Sheet Report uses cascading paramters.

For steps on how to create input parameters (or in BIRT terminology, data-set parameters) see the following section in the BIRT RCP Designer online help: BIRT Report Developer Guide > Field Guide to BIRT > Enabling the User to Filter Data.

Creating a Receipt Template (Administrative Documents)

The Administrative Documents feature in Mifos allows you to generate a receipt for an account -- without having to use the Reports tab. You can also use this feature to generate other administrative documents specific to an account, such as vouchers and passbooks.

To create a receipt template:

  1. In BIRT, open a new template. You do not need to specify a data source -- the Mifos database will be automatically used.
  2. Use the following parameters, in the following order:
  • userId
  • account_id
  • reportName
  1. In Mifos, upload the template using the Upload new Admin document link on the Admin tab. A receipt link will automatically appear on client loan account pages. Note the template must be a BIRT report design document which has an extension of '.rptdesign'.

When you click an account's receipt link, the system automatically passes in the account ID of the loan account and generates a receipt, based on the BIRT template design you uploaded.

Localizing your Report

To add labels in another language:

  1. With your report loaded in BIRT RCP Designer, click the Layout tab.
  2. Select your report by clicking white space or a margin in your report.
  3. In the Property Editor window on the bottom, select Resources.
  4. Add resources using the following naming convention: [file name]_[language]_[country].properties. For example: EndaTransactionReport_fr_FR.properties and EndaTransactionReport_en_US.properties

Tips for populating the properties file(s):

  • Take the raw column names, such as customer_name, government_id, etc., and add them to the .properties file(s). You can get them from the output columns in the data set or from the xml in the XML Source tab.
  • If you've already re-named the column headers with user-friendly names, you can type them into the .properties file.
  • Column header text must exactly match the text in the .properties file.
  • To run the report in BIRT RCP Designer in a specific locale, on the Windows menu of BIRT RCP Designer click Preferences > Report Design > Preview > Choose your locale. Note that the file name suffix must correspond to the locale. See Java locale naming conventions.

Uploading and Editing your Report

To upload and view your report:

  1. On the Admin tab in Mifos, click Upload report templates under Manage Reports.
  2. Provide the report name, choose the Reports tab category under which you want your report to appear, then click Preview > Submit.
  3. To view the report, click your report's name on the Reports tab, select and/or enter the parameters, then click Generate.

To edit your report:

  1. On the Admin tab, click the View report templates under Manage Reports.
  2. Click Edit.

Controlling Access to Reports

Mifos allows you to control two things related to report security:

  • What Mifos users can do with reports (download, edit, delete, etc.).
  • Which report data users can see.

You handle the first by associating report-related actions with specific user roles. You handle the second by incorporating one or more parameters in your report that are based on organizational hierarchy.

Associating Report Actions with a Role

To manage the permissions related to a report:

  1. Ensure that you are logged in as admin.
  2. On the Admin tab, click Manage roles and permissions under Manage Organization.
  3. Choose a role or create a new one.
  4. Select or clear the report permissions you want associated with that role.
  5. Click Submit.

Hierarchy and Data Scoping

If a report has parameters based on organizational hierarchy, a user's access to that report is affected by her position in the organization's hierarchy. For example, if a user is assigned to the Head Office, which is the top of the hierarchy, she can see all report data. If a user is assigned to Branch A, she can only see data for Branch A. If a user is a loan officer, she can only see data for her clients.

0
Your rating: None

Troubleshooting

Troubleshooting

A Common BIRT Error

The following error indicates that you are using a BIRT extension of Eclipse, instead of the BIRT RCP:

		ERROR [STDERR] Caused by: Error.DesignFileException.INVALID_XML - 1 errors found!
1.)  (line = 0, tag = null)
org.eclipse.birt.report.model.parser.DesignParserException
(code =  Error.DesignParserException.UNSUPPORTED_VERSION, message : The report
file of version "3.2.14" is not supported.)

To resolve this error, install the BIRT RCP.

Known Issues

  • The names of the branch, LoanOfficer, and loan product parameter that Mifos gets from the database are in alphabetical order, but in the BIRT parameter list, it has no order. This is due to a bug in BIRT that has been fixed in the latest BIRT 2.1.3 build.
  • According to the business logic, the best choice for the "loan number" column in report 1 is globalAccountNum. loan account id, another logical choice, is a sequential number in the database, each loan account id corresponds to one account. loan account id means nothing outside the Mifos database; !globalAccountNum does.
  • The method, "!getTotalPrincipleAmountInArrears" does not consider lateness, it only returns the principal that is overdue.
  • The default value of Branch parameter is "BSK", but the default value of LoanOfficer parameter is null.
  • LoanOfficer and LoanProduct should display "All".
0
Your rating: None

Jasper Reports

Jasper is a reporting tool that several users have chosen to build their reports.  Pentaho has replaced Jasper and BIRT as our standard reporting solution. All custom reports should be built on Pentaho. For more on Jasper, browse this documentation on Jasper created by SunGard. 

0
Your rating: None

Pentaho Reports

0
Your rating: None