/**
   * Convert report parameter value object into string.
   *
   * @param reportParameterObj report parameter value object.
   * @return parameter value in string.
   */
  public String format(Object reportParameterObj) {
    String reportParameterValue = null;

    if (reportParameterObj != null && uLocale != null) {
      if (reportParameterObj instanceof String) {
        StringFormatter sf = getStringFormatter();
        if (sf != null) {
          reportParameterValue = sf.format((String) reportParameterObj);
        } else {
          reportParameterValue = reportParameterObj.toString();
        }
      } else if (reportParameterObj instanceof Date) {
        DateFormatter df = getDateFormatter();
        if (df != null) {
          reportParameterValue = df.format((Date) reportParameterObj);
        } else {
          reportParameterValue = reportParameterObj.toString();
        }
      } else if (reportParameterObj instanceof Double) {
        NumberFormatter nf = getNumberFormatter();
        if (nf != null) {
          reportParameterValue = nf.format(((Double) reportParameterObj).doubleValue());
        } else {
          reportParameterValue = reportParameterObj.toString();
        }
      } else if (reportParameterObj instanceof BigDecimal) {
        NumberFormatter nf = getNumberFormatter();
        if (nf != null) {
          reportParameterValue = nf.format((BigDecimal) reportParameterObj);
        } else {
          reportParameterValue = reportParameterObj.toString();
        }
      } else if (reportParameterObj instanceof Boolean) {
        reportParameterValue = ((Boolean) reportParameterObj).toString();
      } else if (reportParameterObj instanceof Number) {
        NumberFormatter nf = getNumberFormatter();
        if (nf != null) {
          reportParameterValue = nf.format(((Number) reportParameterObj));
        } else {
          reportParameterValue = reportParameterObj.toString();
        }
      } else {
        reportParameterValue = (reportParameterObj.toString());
      }
    }

    return reportParameterValue;
  }
 /**
  * localize the value to a string.
  *
  * @param value
  * @param style
  * @param locale
  * @return
  */
 protected String localizeValue(Object value, IScriptStyle style) {
   if (value == null) {
     return null;
   }
   if (value instanceof Number) {
     String format = getNumberFormat(style);
     NumberFormatter fmt = getNumberFormatter(format);
     ;
     return fmt.format((Number) value);
   }
   if (value instanceof java.util.Date) {
     String format = getDateFormat(style, (java.util.Date) value);
     DateFormatter fmt = getDateFormatter(format);
     return fmt.format((Date) value);
   } else if (value instanceof String) {
     String format = getStringFormat(style);
     StringFormatter fmt = getStringFormatter(format);
     return fmt.format((String) value);
   }
   return value.toString();
 }