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
public void renderReport( String docName, String pageRange,
			InputOptions renderOptions, OutputStream out )
			throws ReportServiceException
	{
		IReportDocument doc = ReportEngineService.getInstance( )
				.openReportDocument( getReportDesignName( renderOptions ),
						docName );
		HttpServletRequest request = ( HttpServletRequest ) renderOptions
				.getOption( InputOptions.OPT_REQUEST );
		Locale locale = ( Locale ) renderOptions
				.getOption( InputOptions.OPT_LOCALE );
		Boolean isMasterPageContent = ( Boolean ) renderOptions
				.getOption( InputOptions.OPT_IS_MASTER_PAGE_CONTENT );
		boolean isMasterPage = isMasterPageContent == null ? false
				: isMasterPageContent.booleanValue( );
		Boolean svgFlag = ( Boolean ) renderOptions
				.getOption( InputOptions.OPT_IS_MASTER_PAGE_CONTENT );
		boolean isSvg = svgFlag == null ? false : svgFlag.booleanValue( );
		Long pageNum = null;
		if ( pageRange != null && pageRange.trim( ).length( ) >= 0 )
			pageNum = Long.valueOf( pageRange );
		long page = -1;
		if ( pageNum != null )
			page = pageNum.longValue( );
		try
		{
			ReportEngineService.getInstance( ).renderReport( out, request, doc,
					page, isMasterPage, isSvg, null, locale );
			doc.close( );
		}