=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/preview/action/XMLStructureResponse.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/preview/action/XMLStructureResponse.java 2009-11-09 06:59:22 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/preview/action/XMLStructureResponse.java 2009-11-09 08:02:08 +0000 @@ -218,17 +218,19 @@ FileInputStream fis = new FileInputStream( this.PATH_FILE_NAME ); org.apache.poi.ss.usermodel.Workbook wb = new HSSFWorkbook( fis ); - if ( sheetId > 0 ) { - - this.recalculatedValueForCellFormula( wb, sheetId ); + if ( sheetId > 0 ) + { + + this.recalculatedValueForCellFormula( wb, (sheetId - 1) ); } - else { + else + { for ( int sheet = 0; sheet < WORKBOOK.getNumberOfSheets(); sheet++ ) { - this.recalculatedValueForCellFormula( wb, sheetId -1); + this.recalculatedValueForCellFormula( wb, sheet ); } } - + if ( bWriteDescription ) { this.writeXMLDescription( sheetId ); @@ -269,7 +271,7 @@ // ------------------------------------------------------------------------- // Sub-methods // ------------------------------------------------------------------------- - + private void writeBySheetNo( org.apache.poi.ss.usermodel.Workbook wb, int sheetNo, boolean bDetailed ) { Sheet s = WORKBOOK.getSheet( sheetNo ); @@ -295,7 +297,7 @@ // information if ( (cell[j].getType() != CellType.EMPTY) || (cell[j].getCellFormat() != null) ) { - + // end of checking the cell formula STRUCTURE_DATA_RESPONSE.append( "