if ( configMap != null )
if ( configValue != null && configValue.length( ) > 0 )
	public static void prepareParameterBean( IViewerReportDesignHandle designHandle,			IViewerReportService service, HttpServletRequest request,			ScalarParameterBean parameterBean, ParameterDefinition parameter,			Locale locale, boolean isDesigner ) throws ReportServiceException	{		// Display name		String displayName = parameter.getPromptText( );		displayName = ( displayName == null || displayName.length( ) <= 0 ) ? parameter				.getDisplayName( )				: displayName;		displayName = ( displayName == null || displayName.length( ) <= 0 ) ? parameter				.getName( )				: displayName;		displayName = ParameterAccessor.htmlEncode( displayName );		parameterBean.setDisplayName( displayName );		// Default value.		InputOptions options = new InputOptions( );		options.setOption( InputOptions.OPT_REQUEST, request );		Object paramDefaultValueObj = service.getParameterDefaultValue(				designHandle, parameterBean.getName( ), options );		// isRequired		switch ( parameter.getDataType( ) )		{			case ParameterDefinition.TYPE_STRING:			{				assert paramDefaultValueObj instanceof String;					parameterBean.setRequired( false );					if ( paramDefaultValueObj == null && !parameter.allowNull( ) )				{					parameterBean.setRequired( true );				} else if ( paramDefaultValueObj != null						&& ( ( String ) paramDefaultValueObj ).length( ) <= 0						&& !parameter.allowBlank( ) )				{					parameterBean.setRequired( true );				}					break;			}			default:			{				parameterBean.setRequired( paramDefaultValueObj == null );				break;			}		}		// Current value		String format = parameter.getPattern( );		ReportParameterConverter converter = new ReportParameterConverter(				format, locale );		String parameterDefaultValue = converter.format( paramDefaultValueObj );		// Get value from test config		if ( isDesigner )		{			// It's ok to use ReportEngineService directly here since we know we			// are in the designer			Map configMap = null;			if ( designHandle.getContentType() == IViewerReportDesignHandle.RPT_RUNNABLE_OBJECT )			{				IReportRunnable runnable = (IReportRunnable)designHandle.getDesignObject();				configMap = runnable.getTestConfig( );			}			else			{ 				try 				{ 					IReportRunnable runnable = ReportEngineService.getInstance( ) 							.openReportDesign( designHandle.getFileName() ); 					configMap = runnable.getTestConfig( ); 				} 				catch ( EngineException e ) 				{ 					throw new ReportServiceException( e.getLocalizedMessage( ) ); 				}			}			if ( configMap != null )			{				String configValue = ( String ) configMap.get( parameter						.getName( ) );				if ( configValue != null && configValue.length( ) > 0 )				{					ReportParameterConverter cfgConverter = new ReportParameterConverter(							format, Locale.US ); 					Object configValueObj = cfgConverter.parse( configValue,							parameter.getDataType( ) );					parameterDefaultValue = converter.format( configValueObj );				}			}		}		parameterBean.setValue( ParameterAccessor.getReportParameter( request,				parameter.getName( ), parameterDefaultValue ) );	}