------------------------------------------------------------ revno: 2695 committer: Hieu <hieu.hispviet...@gmail.com> branch nick: dhis2 timestamp: Fri 2011-01-21 13:58:41 +0700 message: FIxed bug <705273> Validation rule reports exception for PDF files with no record. And minor fixed in code style. modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Grid.java dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetExpressionTextAction.java dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/result/GridPdfResult.java
-- 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-api/src/main/java/org/hisp/dhis/common/Grid.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Grid.java 2011-01-14 17:42:33 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Grid.java 2011-01-21 06:58:41 +0000 @@ -95,7 +95,7 @@ int getVisibleWidth(); /** - * Adds a new row the the grid and moves the cursor accordingly. + * Adds a new row to the grid and moves the cursor accordingly. */ Grid nextRow(); === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java 2010-08-31 08:12:53 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java 2011-01-21 06:58:41 +0000 @@ -44,8 +44,6 @@ public class GetDataElementGroupsAction implements Action { - - // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetExpressionTextAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetExpressionTextAction.java 2010-09-01 16:55:23 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetExpressionTextAction.java 2011-01-21 06:58:41 +0000 @@ -93,7 +93,5 @@ return ERROR; } - } - } === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/result/GridPdfResult.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/result/GridPdfResult.java 2011-01-14 18:10:02 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/result/GridPdfResult.java 2011-01-21 06:58:41 +0000 @@ -80,6 +80,8 @@ Grid _grid = (Grid) invocation.getStack().findValue( "grid" ); grid = _grid != null ? _grid : grid; + + int width = grid.getVisibleWidth() == 0 ? 1 : grid.getVisibleWidth(); // --------------------------------------------------------------------- // Configure response @@ -99,21 +101,21 @@ Document document = openDocument( out ); - PdfPTable table = new PdfPTable( grid.getVisibleWidth() ); + PdfPTable table = new PdfPTable( width ); table.setHeaderRows( 1 ); - table.addCell( getTitleCell( grid.getTitle(), grid.getVisibleWidth() ) ); - table.addCell( getEmptyCell( grid.getVisibleWidth(), 30 ) ); - table.addCell( getSubtitleCell( grid.getSubtitle(), grid.getVisibleWidth() ) ); - table.addCell( getEmptyCell( grid.getVisibleWidth(), 30 ) ); + table.addCell( getTitleCell( grid.getTitle(), width ) ); + table.addCell( getEmptyCell( width, 30 ) ); + table.addCell( getSubtitleCell( grid.getSubtitle(), width ) ); + table.addCell( getEmptyCell( width, 30 ) ); for ( GridHeader header : grid.getVisibleHeaders() ) { table.addCell( getItalicCell( header.getName() ) ); } - table.addCell( getEmptyCell( grid.getVisibleWidth(), 10 ) ); + table.addCell( getEmptyCell( width, 10 ) ); for ( List<String> row : grid.getVisibleRows() ) {
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp