=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/action/ExportToExcelAction.java' --- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/action/ExportToExcelAction.java 2010-06-04 11:50:05 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/action/ExportToExcelAction.java 2010-09-23 11:04:04 +0000 @@ -26,24 +26,32 @@ import jxl.write.WritableWorkbook; import org.apache.struts2.ServletActionContext; -import org.hisp.dhis.external.location.LocationManager; +import org.hisp.dhis.config.ConfigurationService; +import org.hisp.dhis.config.Configuration_IN; import com.keypoint.PngEncoder; +import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionContext; -import com.opensymphony.xwork2.ActionSupport; -public class ExportToExcelAction extends ActionSupport +public class ExportToExcelAction implements Action { // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- - +/* private LocationManager locationManager; public void setLocationManager( LocationManager locationManager ) { this.locationManager = locationManager; } + */ + private ConfigurationService configurationService; + + public void setConfigurationService( ConfigurationService configurationService ) + { + this.configurationService = configurationService; + } // ------------------------------------------------------------------------- // Input & output @@ -149,14 +157,14 @@ else if(chartDisplayOption.equalsIgnoreCase("desend")) { sortByDesscending(); } else if(chartDisplayOption.equalsIgnoreCase("alphabet")) { sortByAlphabet(); } - File outputReportFile = locationManager.getFileForWriting( UUID.randomUUID().toString() + ".xls", "db", "output" ); - - /* - String outputReportPath = System.getProperty( "user.home" ) + File.separator + "dhis" + File.separator + "ra" + //File outputReportFile = locationManager.getFileForWriting( UUID.randomUUID().toString() + ".xls", "db", "output" ); + + + String outputReportFile = System.getProperty( "user.home" ) + File.separator + "dhis" + File.separator + configurationService.getConfigurationByKey( Configuration_IN.KEY_REPORTFOLDER ).getValue() + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls"; - */ + - WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( outputReportFile ); + WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File(outputReportFile) ); WritableSheet sheet0 = outputReportWorkbook.createSheet( "ChartOutput", 0 ); if(viewSummary.equals( "no" )) === modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java' --- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java 2010-09-22 12:16:23 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java 2010-09-23 11:04:04 +0000 @@ -1528,33 +1528,7 @@ } } } - //22/09/2010 add - Double tempVal = aggregationService - .getAggregatedIndicatorValue( ind, startPeriod.getStartDate(), endPeriod.getEndDate(), - childOrgUnit ); - - if( tempVal != null) - { - serviceValues[countForServiceList][countForChildOrgUnitList] /= noOfChildren; - serviceValues[countForServiceList][countForChildOrgUnitList] = Math - .round( serviceValues[countForServiceList][countForChildOrgUnitList] * Math.pow( 10, 1 ) ) - / Math.pow( 10, 1 ); - - numVal = Math.round( numVal * Math.pow( 10, 1 ) ) / Math.pow( 10, 1 ); - denVal = Math.round( denVal * Math.pow( 10, 1 ) ) / Math.pow( 10, 1 ); - } - else - { - serviceValues[countForServiceList][countForChildOrgUnitList] = 0.0; - serviceValues[countForServiceList][countForChildOrgUnitList] = 0.0; - numVal = 0.0; - denVal = 0.0; - } - - // end 22/09/2010 - - - + serviceValues[countForServiceList][countForChildOrgUnitList] /= noOfChildren; serviceValues[countForServiceList][countForChildOrgUnitList] = Math .round( serviceValues[countForServiceList][countForChildOrgUnitList] * Math.pow( 10, 1 ) ) === modified file 'local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml' --- local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2010-09-04 13:07:00 +0000 +++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2010-09-23 11:04:04 +0000 @@ -765,9 +765,11 @@ - + + +