=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/RenderReportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/RenderReportAction.java 2010-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/RenderReportAction.java 2010-11-29 22:36:15 +0000
@@ -28,6 +28,7 @@
*/
import java.io.OutputStream;
+import java.sql.Connection;
import javax.servlet.http.HttpServletResponse;
@@ -37,11 +38,11 @@
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
+import org.amplecode.quick.StatementManager;
import org.hisp.dhis.report.Report;
import org.hisp.dhis.report.ReportService;
import org.hisp.dhis.system.util.StreamUtils;
import org.hisp.dhis.util.StreamActionSupport;
-import org.springframework.jdbc.core.JdbcTemplate;
/**
* @author Lars Helge Overland
@@ -61,11 +62,11 @@
this.reportService = reportService;
}
- private JdbcTemplate jdbcTemplate;
+ private StatementManager statementManager;
- public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
+ public void setStatementManager( StatementManager statementManager )
{
- this.jdbcTemplate = jdbcTemplate;
+ this.statementManager = statementManager;
}
// -------------------------------------------------------------------------
@@ -91,9 +92,23 @@
JasperReport jasperReport = JasperCompileManager.compileReport( StreamUtils.getInputStream( report.getDesignContent() ) );
- JasperPrint print = JasperFillManager.fillReport( jasperReport, null, jdbcTemplate.getDataSource().getConnection() );
-
- JasperExportManager.exportReportToPdfStream( print, out );
+ Connection connection = statementManager.getHolder().getConnection();
+
+ JasperPrint print = null;
+
+ try
+ {
+ print = JasperFillManager.fillReport( jasperReport, null, connection );
+ }
+ finally
+ {
+ connection.close();
+ }
+
+ if ( print != null )
+ {
+ JasperExportManager.exportReportToPdfStream( print, out );
+ }
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2010-11-23 08:13:14 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2010-11-29 22:36:15 +0000
@@ -374,8 +374,8 @@
scope="prototype">
-
+
#if ( $!reportParams.isParamParentOrganisationUnit() || $!reportParams.isParamOrganisationUnit() )
-
+
$i18n.getString( "organisation_unit" ) |
-
+
|