dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16851
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6527: Fixed bug in ReportController
------------------------------------------------------------
revno: 6527
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-04-08 20:46:37 +0200
message:
Fixed bug in ReportController
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ReportController.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ReportController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ReportController.java 2012-03-22 15:04:58 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ReportController.java 2012-04-08 18:46:37 +0000
@@ -136,8 +136,8 @@
@RequestMapping( value = {"/{uid}/data", "/{uid}/data.pdf"}, method = RequestMethod.GET )
public void getReportAsPdf( @PathVariable( "uid" ) String uid,
@RequestParam( value = "ou", required = false ) String organisationUnitUid,
- @RequestParam( value = "pe", required = false ) String period, HttpServletResponse response )
- throws Exception
+ @RequestParam( value = "pe", required = false ) String period,
+ HttpServletResponse response ) throws Exception
{
getReport( uid, organisationUnitUid, period, response, "pdf", ContextUtils.CONTENT_TYPE_PDF, false );
}
@@ -145,8 +145,8 @@
@RequestMapping( value = "/{uid}/data.xls", method = RequestMethod.GET )
public void getReportAsXls( @PathVariable( "uid" ) String uid,
@RequestParam( value = "ou", required = false ) String organisationUnitUid,
- @RequestParam( value = "pe", required = false ) String period, HttpServletResponse response )
- throws Exception
+ @RequestParam( value = "pe", required = false ) String period,
+ HttpServletResponse response ) throws Exception
{
getReport( uid, organisationUnitUid, period, response, "xls", ContextUtils.CONTENT_TYPE_EXCEL, true );
}
@@ -160,7 +160,7 @@
{
Report report = reportService.getReport( uid );
- if ( report.hasReportTable() && report.getReportTable().hasReportParams()
+ if ( organisationUnitUid == null && report.hasReportTable() && report.getReportTable().hasReportParams()
&& report.getReportTable().getReportParams().isOrganisationUnitSet() )
{
organisationUnitUid = organisationUnitService.getRootOrganisationUnits().iterator().next().getUid();