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
IViewerReportDesignHandle design = new BirtViewerReportDesignHandle(
				null, fileName );
		return design;
	}
	
	public ByteArrayOutputStream getPage( String docName, String pageID,
			InputOptions renderOptions, List activeIds )
			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 svgFlag = ( Boolean ) renderOptions
				.getOption( InputOptions.OPT_IS_MASTER_PAGE_CONTENT );
		Long pageNum = Long.valueOf( pageID );
		try
		{
			ByteArrayOutputStream os = ReportEngineService.getInstance( )
					.renderReport( request, doc, pageNum.longValue( ),
							isMasterPageContent.booleanValue( ),
							svgFlag.booleanValue( ), activeIds, locale );
			doc.close( );
			return os;
		}