=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/GenerateAdvancedReportExcelCategoryAction.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/GenerateAdvancedReportExcelCategoryAction.java 2009-10-02 02:58:42 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/GenerateAdvancedReportExcelCategoryAction.java 2009-10-03 05:55:31 +0000 @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.hisp.dhis.reportexcel.export.action; +package org.hisp.dhis.reportexcel.export.advance.action; import java.io.BufferedInputStream; import java.io.FileInputStream; @@ -112,15 +112,7 @@ } - outputReportWorkbook.write(); - - outputReportWorkbook.close(); - - outputXLS = outputReportFile.getName(); - - inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) ); - - outputReportFile.delete(); + this.complete(); statementManager.destroy(); === modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/GenerateAdvancedReportExcelNormalAction.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/GenerateAdvancedReportExcelNormalAction.java 2009-10-02 02:58:42 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/GenerateAdvancedReportExcelNormalAction.java 2009-10-03 05:55:31 +0000 @@ -27,8 +27,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.io.BufferedInputStream; -import java.io.FileInputStream; import java.util.Collection; import java.util.Iterator; import java.util.Set; @@ -82,10 +80,9 @@ // Action implementation // --------------------------------------------------------------------- - public String execute() + public String execute()throws Exception { - try - { + Period period = selectionManager.getSelectedPeriod(); this.installExcelFormat(); @@ -93,7 +90,7 @@ this.installPeriod( period ); OrganisationUnitGroup organisationUnitGroup = organisationUnitGroupService - .getOrganisationUnitGroup( organisationGroupId.intValue() ); + .getOrganisationUnitGroup( organisationGroupId ); Set organisationList = organisationUnitGroup.getMembers(); @@ -127,25 +124,14 @@ } - outputReportWorkbook.write(); - - outputReportWorkbook.close(); - - outputXLS = outputReportFile.getName(); - - inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) ); - - outputReportFile.delete(); + this.complete(); statementManager.destroy(); return SUCCESS; - } - catch ( Exception ex ) - { - ex.printStackTrace(); - } - return ERROR; + + + } } === modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/GenerateAdvancedReportExcelOrganisationGroupListingAction.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/GenerateAdvancedReportExcelOrganisationGroupListingAction.java 2009-10-02 02:58:42 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/GenerateAdvancedReportExcelOrganisationGroupListingAction.java 2009-10-03 05:55:31 +0000 @@ -113,15 +113,7 @@ } - outputReportWorkbook.write(); - - outputReportWorkbook.close(); - - outputXLS = outputReportFile.getName(); - - inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) ); - - outputReportFile.delete(); + this.complete(); statementManager.destroy(); === modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2009-10-02 02:58:42 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2009-10-03 05:55:31 +0000 @@ -328,10 +328,10 @@ - + + scope="prototype"> @@ -463,7 +463,7 @@ - + - + - - - - - + + - + scope="prototype" /> + - - + + - + - - - - + + + + @@ -620,26 +613,19 @@ scope="prototype"> - - + + - + - - - - + + + + @@ -650,169 +636,155 @@ scope="prototype"> - - + + - + - - - - + + + + - + - - + + - + - - - - + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml 2009-10-02 07:58:30 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml 2009-10-03 05:55:31 +0000 @@ -628,7 +628,7 @@ + class="org.hisp.dhis.reportexcel.export.advance.action.GetOrganisationUnitGroupListAction"> /dhis-web-excel-reporting/responseOrganisationUnitGroupObjects.vm @@ -650,42 +650,26 @@ - - application/vnd.ms-excel - inputStream - filename="${outputXLS}" - 1024 - + + /dhis-web-excel-reporting/responseSuccess.vm - - application/vnd.ms-excel - inputStream - filename="${outputXLS}" - 1024 - + + /dhis-web-excel-reporting/responseSuccess.vm - - application/vnd.ms-excel - inputStreamg - filename="${outputXLS}" - 1024 - + + /dhis-web-excel-reporting/responseSuccess.vm - - application/vnd.ms-excel - inputStream - filename="${outputXLS}" - 1024 - + + /dhis-web-excel-reporting/responseSuccess.vm === modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js 2009-10-02 07:58:30 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js 2009-10-03 05:55:31 +0000 @@ -69,15 +69,16 @@ function generateAdvancedReportExcel() { - var reportId = $('#report').val(); - var periodId = $('#period').val(); - var organisationGroupId = byId('availableOrgunitGroups').value; - var url = "generateAdvancedReportExcel.action?reportId=" + reportId ; - url += "&periodId=" + periodId ; - url += "&organisationGroupId=" + organisationGroupId; - url += "&reportType=normal"; - - window.location = url; + $("#loading").showAtCenter( true ); + $.post("generateAdvancedReportExcel.action",{ + reportId:$('#report').val(), + periodId:$('#period').val(), + organisationGroupId:$('#availableOrgunitGroups').val() + },function(data){ + window.location = "downloadExcelOutput.action"; + deleteDivEffect(); + $("#loading").hide(); + },'xml'); }