dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17887
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7304: Fixed bug with jrxml rendering of report table
------------------------------------------------------------
revno: 7304
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-06-14 20:56:38 +0200
message:
Fixed bug with jrxml rendering of report table
modified:
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/ExportTableAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/reportTableGrid.vm
--
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-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/ExportTableAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/ExportTableAction.java 2012-05-31 21:51:26 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/ExportTableAction.java 2012-06-14 18:56:38 +0000
@@ -154,29 +154,26 @@
// -------------------------------------------------------------------------
@Override
- @SuppressWarnings("unchecked")
public String execute()
throws Exception
{
+ ReportTable reportTable = reportTableService.getReportTable( uid );
+
+ params.putAll( constantService.getConstantParameterMap() );
+ params.putAll( reportTable.getOrganisationUnitGroupMap( organisationUnitGroupService.getCompulsoryOrganisationUnitGroupSets() ) );
+
if ( useLast )
{
grid = (Grid) SessionUtils.getSessionVar( SessionUtils.KEY_REPORT_TABLE_GRID );
- params = (Map<String, Object>) SessionUtils.getSessionVar( SessionUtils.KEY_REPORT_TABLE_PARAMS );
}
else
{
- ReportTable reportTable = reportTableService.getReportTable( uid );
-
Date date = pe != null ? DateUtils.getMediumDate( pe ) : new Date();
- grid = reportTableService.getReportTableGrid( uid, format, date, ou );
-
- params.putAll( constantService.getConstantParameterMap() );
- params.putAll( reportTable.getOrganisationUnitGroupMap( organisationUnitGroupService.getCompulsoryOrganisationUnitGroupSets() ) );
+ grid = reportTableService.getReportTableGrid( uid, format, date, ou );
}
SessionUtils.setSessionVar( SessionUtils.KEY_REPORT_TABLE_GRID, grid );
- SessionUtils.setSessionVar( SessionUtils.KEY_REPORT_TABLE_PARAMS, params );
return type != null ? type : DEFAULT_TYPE;
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js 2012-06-04 12:52:49 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js 2012-06-14 18:56:38 +0000
@@ -65,9 +65,9 @@
// Report table
// -----------------------------------------------------------------------------
-function exportReport( type )
+function exportReport( type, uid )
{
- var url = "exportTable.action?type=" + type + "&useLast=true";
+ var url = "exportTable.action?uid=" + uid + "&type=" + type + "&useLast=true";
url += $( "#id" ).length ? ( "&id=" + $( "#id" ).val() ) : "";
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/reportTableGrid.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/reportTableGrid.vm 2012-05-31 21:51:26 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/reportTableGrid.vm 2012-06-14 18:56:38 +0000
@@ -9,11 +9,11 @@
</script>
<div>
-<input type="button" value="$i18n.getString( 'get_report_as_xls' )" onclick="exportReport( 'xls' )" style="width:140px">
-<input type="button" value="$i18n.getString( 'get_report_as_csv' )" onclick="exportReport( 'csv' )" style="width:140px">
-<input type="button" value="$i18n.getString( 'get_report_as_pdf' )" onclick="exportReport( 'pdf' )" style="width:140px">
-<input type="button" value="$i18n.getString( 'get_report_as_jasper' )" onclick="exportReport( 'jasper' )" style="width:140px">
-<input type="button" value="$i18n.getString( 'get_report_as_jrxml' )" onclick="exportReport( 'jrxml' )" style="width:140px">
+<input type="button" value="$i18n.getString( 'get_report_as_xls' )" onclick="exportReport( 'xls', '${uid}' )" style="width:140px">
+<input type="button" value="$i18n.getString( 'get_report_as_csv' )" onclick="exportReport( 'csv', '${uid}' )" style="width:140px">
+<input type="button" value="$i18n.getString( 'get_report_as_pdf' )" onclick="exportReport( 'pdf', '${uid}' )" style="width:140px">
+<input type="button" value="$i18n.getString( 'get_report_as_jasper' )" onclick="exportReport( 'jasper', '${uid}' )" style="width:140px">
+<input type="button" value="$i18n.getString( 'get_report_as_jrxml' )" onclick="exportReport( 'jrxml', '${uid}' )" style="width:140px">
<input type="button" value="$i18n.getString( 'share' )" onclick="viewShareForm()" style="width:140px">
<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:window.location.href='displayManageTableForm.action'" style="width:140px">
</div>