Bug 173223 Pages are lost when preview as PDF in web viewer[0002]
Pages are lost when preview as PDF in web viewer[0002] Build number: 2.2.0.v20070207-0941 Steps to reproduce: 1.open attached report design 2.preview in web viewer ,there are three pages,then click Print as PDF,there'll be only one page in PDF,but when you directly preview in PDF,there'll be three pages Expected result: 3 pages are displayed Actual result: only one page is displayed Error log: N/A
viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java
*/
	public static String generateFileName( HttpServletRequest request )
	{
		String defaultName = "BIRTReport"; 
		String fileName = defaultName;
		BaseAttributeBean attrBean = (BaseAttributeBean) request
				.getAttribute( IBirtConstants.ATTRIBUTE_BEAN );
		if ( attrBean == null )
			return fileName + ".pdf"; 
		String baseName = attrBean.getReportDesignName( );
		if ( baseName == null || baseName.length( ) == 0 )
			baseName = attrBean.getReportDocumentName( );
		assert baseName != null && baseName.length( ) > 0;
		int index = baseName.lastIndexOf( '/' );
		if ( index == -1 )
			index = baseName.lastIndexOf( '\\' );
		
		
		if ( index != -1 )
		{
			baseName = baseName.substring( index + 1 );
		}
		
		
		
		int dotIndex = baseName.lastIndexOf( '.' );
		if ( dotIndex > 0 )
		{
			fileName = baseName.substring( 0, dotIndex );
		}