# Bahmni concatenated type report is not working for different data source reports

**URL:** https://talk.openmrs.org/t/bahmni-concatenated-type-report-is-not-working-for-different-data-source-reports/20892
**Category:** Bahmni
**Tags:** bahmni-reports, reports
**Created:** [December 6, 2018, 9:38am UTC](https://talk.openmrs.org/t/bahmni-concatenated-type-report-is-not-working-for-different-data-source-reports/20892 "2018-12-06T09:38:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![saikumarv](https://talk.openmrs.org/user_avatar/talk.openmrs.org/saikumarv/32/7657_2.png) [@saikumarv](https://talk.openmrs.org/u/saikumarv)
#### Post date: [December 6, 2018, 9:38am UTC](https://talk.openmrs.org/t/bahmni-concatenated-type-report-is-not-working-for-different-data-source-reports/20892/1 "2018-12-06T09:38:24Z")

</div>

Bahmni reports have a “concatenated” type of configuration to get a combined report containing different child reports inside. You can find more information [here](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/90472551/Reports#Reports-ReportConcatMultipleReports7.ConcatenatingMultipleReports)

We found a bug in this feature. If we configure a concatenated report with 2 child reports inside, where one is OpenElis report and the other is OpenMRS report, in this case, the report which should run on OpenElis database fails with an error whereas OpenMRS database report works fine.

Actually, it’s trying to execute all report queries on the OpenMRS database if it’s a “concatenated” type one. It’s not considering “type”(useful to find the data source) property of each child report.

This is the configuration we used to make the concatenated report that fetches data from 2 different DBs.

 ![48%20PM](https://talk.openmrs.org/uploads/default/original/2X/2/2d7c1fda3f4481eeb232dd6562e4dd2d7e20adab.png)

1. Are we missing any needed configuration?

2. Is there any way to achieve this kind of concatenated report from two different databases?@angshuonline @pramidat @swathivarkala @binduak @sumanmaity112 @mksd @ramses

---

<div class="post-metadata">

### Author: ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)
#### Post date: [December 6, 2018, 11:43am UTC](https://talk.openmrs.org/t/bahmni-concatenated-type-report-is-not-working-for-different-data-source-reports/20892/2 "2018-12-06T11:43:54Z")

</div>

Ok so I’m not familiar with this type of configuration at all, but I looked quickly through the code base and found [this](https://github.com/Bahmni/bahmni-reports/blob/bd77658d4f3d553bbb41889138667fab5b2cb543/src/main/java/org/bahmni/reports/web/ReportGenerator.java#L44-L55).

It looks like that while there can be multiple reports to concatenate (`reports` can be an array with a size \> 1), there is always only **one** connection to the database. So at first sight it looks like your use case is not supported. @angshuonline might confirm this.

---

<div class="post-metadata">

### Author: ![sumanmaity112](https://talk.openmrs.org/user_avatar/talk.openmrs.org/sumanmaity112/32/4608_2.png) [@sumanmaity112](https://talk.openmrs.org/u/sumanmaity112)
#### Post date: [December 6, 2018, 2:14pm UTC](https://talk.openmrs.org/t/bahmni-concatenated-type-report-is-not-working-for-different-data-source-reports/20892/3 "2018-12-06T14:14:06Z")

</div>

Currently, the code is written in such a way that all the **concatenated** reports are only run on **OpenMRS** database (please have a look into [this](https://github.com/Bahmni/bahmni-reports/blob/master/src/main/java/org/bahmni/reports/template/OpenmrsConcatenatedReportTemplate.java#L6)). To make it work we have to implement it. We have to write in such a way that it’s backwards compatible.
