=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportAndParamsAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportAndParamsAction.java 2013-01-31 14:48:30 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportAndParamsAction.java 2013-02-02 19:59:51 +0000 @@ -107,6 +107,13 @@ { return organisationUnitHierarchy; } + + private List organisationUnitChildren = new ArrayList(); + + public List getOrganisationUnitChildren() + { + return organisationUnitChildren; + } private List periods; @@ -138,6 +145,8 @@ parent = parent.getParent(); organisationUnitHierarchy.add( parent ); } + + organisationUnitChildren.addAll( organisationUnit.getChildren() ); } } === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm 2013-02-02 19:22:58 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm 2013-02-02 19:59:51 +0000 @@ -31,6 +31,19 @@ #end #end ]; + +dhis2.report.organisationUnitChildren = [ +#if( $organisationUnitChildren ) +#set( $size = $organisationUnitChildren.size() ) +#foreach( $ou in $organisationUnitChildren ) +{ + "id": "$!encoder.htmlEncode( ${ou.uid} )", + "name": "$!encoder.htmlEncode( ${ou.name} )", + "code": "$!encoder.htmlEncode( ${ou.code} )" +}#if( $velocityCount < $size ),#end +#end +#end +];