* @author Lars Helge Overland
@@ -93,7 +91,7 @@
// Supportive methods
// -------------------------------------------------------------------------
- private void getReport( String uid, String organisationUnitUid, String period,
+ private void getReport( String uid, String organisationUnitUid, String isoPeriod,
HttpServletResponse response, String type, String contentType, boolean attachment ) throws Exception
{
Report report = reportService.getReport( uid );
@@ -104,12 +102,12 @@
organisationUnitUid = organisationUnitService.getRootOrganisationUnits().iterator().next().getUid();
}
- Date date = period != null ? DateUtils.getMediumDate( period ) : new Cal().now().subtract( Calendar.MONTH, 1 ).time();
-
+ Period period = isoPeriod != null ? PeriodType.getPeriodFromIsoString( isoPeriod ) : new MonthlyPeriodType().createPeriod();
+
String filename = CodecUtils.filenameEncode( report.getName() ) + "." + type;
contextUtils.configureResponse( response, contentType, CacheStrategy.RESPECT_SYSTEM_SETTING, filename, attachment );
- reportService.renderReport( response.getOutputStream(), uid, date, organisationUnitUid, type,
+ reportService.renderReport( response.getOutputStream(), uid, period, organisationUnitUid, type,
i18nManager.getI18nFormat() );
}
}
=== 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-07-02 19:27:19 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/ExportTableAction.java 2012-09-24 12:52:15 +0000
@@ -35,9 +35,10 @@
import org.hisp.dhis.constant.ConstantService;
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.reporttable.ReportTable;
import org.hisp.dhis.reporttable.ReportTableService;
-import org.hisp.dhis.system.util.DateUtils;
import org.hisp.dhis.util.SessionUtils;
import com.opensymphony.xwork2.Action;
@@ -174,7 +175,9 @@
}
else
{
- Date date = pe != null ? DateUtils.getMediumDate( pe ) : new Date();
+ Period period = PeriodType.getPeriodFromIsoString( pe );
+
+ Date date = period != null ? period.getStartDate() : new Date();
grid = reportTableService.getReportTableGrid( uid, format, date, ou );
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2012-09-12 15:41:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2012-09-24 12:52:15 +0000
@@ -8,7 +8,7 @@
select_period=Please select a period
select_organisation_unit=Please select an organisation unit
report_organisation_unit= Report organisation unit
-dataset_report= Data set Report
+dataset_report= Data Set Report
add_selected= Add selected
add_all= Add all
add=Add
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm 2012-04-26 15:26:28 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm 2012-09-24 12:52:15 +0000
@@ -31,7 +31,7 @@
|