Bug 140976 assert condition off by one in ReportEngineService
The following assertion appears around line 516 in org.eclipse.birt.report.viewer\birt\WEB-INF\classes\org\eclipse\birt\report\services\ReportEngineService.java assert pageNumber > 0 && pageNumber < reportDocument.getPageCount( ); However, since page numbers start at 1 instead of 0, pageNumber could equal reportDocument.getPageCount(). So the assertion should be assert pageNumber > 0 && pageNumber <= reportDocument.getPageCount( );
viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/BirtViewerReportService.java
runnable = ReportEngineService.getInstance( ).openReportDesign(
						design.getFileName( ) );
			}
			catch ( EngineException e )
			{
				throw new ReportServiceException( e.getLocalizedMessage( ) );
			}
		}
		return runnable;
	}
	private static ToC transformTOCNode( TOCNode node )
	{
		ToC toc = new ToC( node.getNodeID( ), node.getDisplayString( ), node
				.getBookmark( ) );
		toc.setChildren( getToCChildren( node ) );
		return toc;
	}
	private static List getToCChildren( TOCNode node )
	{
		if ( node.getChildren( ) == null )
			return null;
		List children = node.getChildren( );
		List ret = new ArrayList( );
		Iterator it = children.iterator( );
		while ( it.hasNext( ) )
		{
			TOCNode childNode = ( TOCNode ) it.next( );
			ToC child = new ToC( childNode.getNodeID( ), childNode
					.getDisplayString( ), childNode.getBookmark( ) );