com.sage.accpac.sm.crystal.ufl
Class RemoveLeadZero

java.lang.Object
  extended by com.sage.accpac.sm.crystal.ufl.AbstractAccpacFormulaFunction
      extended by com.sage.accpac.sm.crystal.ufl.RemoveLeadZero
All Implemented Interfaces:
com.crystaldecisions.reports.formulas.FormulaFunction, com.crystaldecisions.reports.formulas.FormulaFunctionDefinition

public final class RemoveLeadZero
extends AbstractAccpacFormulaFunction

We recommend that reports avoid using RemoveLeadZero. An analysis of Sage ERP Accpac's own reports show that only 10 existing reports use RemoveLeadZero, but some of those reports (like GL posting journal reports) are regularly customized. The only reason RemoveLeadZero is being ported is so that those customized reports won't have to change.

The "RemoveLeadZero" name is misleading (but we must keep that name for backward compatibility). Based on an analysis of the C UFL code, this formula removes leading zeros, including those that are preceded solely by non-digits (such as the negative sign and whitespace). If there are no leading zeros, the string is returned as-is. If the string only contains zeros, the empty string is returned.

The Crystal arguments to this function are:

  1. The string whose leading zeros (if any) are to be removed

The following are examples of this function's behavior:

Input Output
"000" ""
"000100" "100"
" - 00" " - "
"abc0010234def50" "abc10234def50"
"100" "100"
"-10200" "-10200"
"abc" "abc"
"" ""


Constructor Summary
RemoveLeadZero()
           
 
Method Summary
 com.crystaldecisions.reports.common.value.FormulaValue evaluate(com.crystaldecisions.reports.formulas.FormulaValueReference[] arguments)
          
 com.crystaldecisions.reports.formulas.FormulaFunctionArgumentDefinition[] getArguments()
          
 java.lang.String getIdentifier()
          
 com.crystaldecisions.reports.common.value.FormulaValueType getReturnType()
          
 
Methods inherited from class com.sage.accpac.sm.crystal.ufl.AbstractAccpacFormulaFunction
getIntegerArgument, getStringArgument, validateArgumentValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoveLeadZero

public RemoveLeadZero()
Method Detail

getIdentifier

public java.lang.String getIdentifier()


getReturnType

public com.crystaldecisions.reports.common.value.FormulaValueType getReturnType()


getArguments

public com.crystaldecisions.reports.formulas.FormulaFunctionArgumentDefinition[] getArguments()


evaluate

public com.crystaldecisions.reports.common.value.FormulaValue evaluate(com.crystaldecisions.reports.formulas.FormulaValueReference[] arguments)
                                                                throws com.crystaldecisions.reports.formulas.FormulaFunctionCallException

Throws:
com.crystaldecisions.reports.formulas.FormulaFunctionCallException


Copyright © 2011 Sage Software, Inc. All rights reserved.