Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports
Viewing all articles
Browse latest Browse all 4814

Trying to use custom function from Custom Functions Demo.rpt

$
0
0

I am trying to simply re-use the custom function that is in the Custom Functions Demo.rpt.  I have put the following code in a custom function in a new report (named the same thing) and I get a syntax error.

 

The error is:  "A ( is expected here"  where here it highlights the function name.

 

Here is the code:

 

Function cdFormatCurrencyUsingScaling(value As Currency,

    nDecimalPlaces As Number,

    thousandsSymbol as String,

    millionsSymbol as String) As String

 

    nDecimalPlaces = Round (nDecimalPlaces)

    If nDecimalPlaces < 0 Or nDecimalPlaces > 9 Then

        nDecimalPlaces = 2

    End If

 

    If Abs (value) >= 1000000 Then

        cdFormatCurrencyUsingScaling = CStr (value / 1000000, nDecimalPlaces) + millionsSymbol

    ElseIf Abs (value) >= 1000 Then

        cdFormatCurrencyUsingScaling = CStr (value / 1000, nDecimalPlaces) + thousandsSymbol

    Else

        cdFormatCurrencyUsingScaling = CStr (value, nDecimalPlaces)

    End If

 

End Function


Viewing all articles
Browse latest Browse all 4814

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>