Skip to Content
avatar image
Former Member

Formating Problems using CSTR Function

Hi,

i am using the following formula to search and publish values within crystal Reports using a collector:

This is the coding which works fine with normal numbers:

select{HQ_HMCOPA01_ERG3_BOCRE.Abweichungen COPA BOCRE}

case "Abweichung zum Vorjahr %" : (

s_8 :=           cStr(Round(Val({HQ_HMCOPA01_ERG3_BOCRE.01. Umsatz})),0)

)

default : dummy := "0"

;

{HQ_HMCOPA01_ERG3_BOCRE.Abweichungen COPA BOCRE};

The above mentioned formula has also been used to round up a percentage value.

In BEX it looks like this "screenshot 1":

The original percentage number has been formated within the Query and rounded.

-191,077546761 will be 191,1

This is the result that I need in Crystal as well.

In Crystal I get the following number:   -191.077546761 (it sets an . instead of an ,

So if i use my function above the result will be "screenshot 2"

Any ideas?

Thanks for your help

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 17, 2013 at 03:35 PM

    hi Angelo,

    if you use something like

    totext({HQ_HMCOPA01_ERG3_BOCRE.Abweichungen COPA BOCRE},1,'#,###.##',',')

    you should get the desired result.

    the online help for totext has a description of all the parameters of the totext function.

    cheers,

    jamie

    Add comment
    10|10000 characters needed characters exceeded

    • a couple of things that could be going wrong:

      1) if you're creating a case statement or an if then else statement, the output types of each case must match...i.e. in your case they must all be string type

      2) you can't use totext on a string...you can use tonumber on a string and then totext it afterwards though

      if the above doesn't fix it, we'd really need to the exact error produced as well as the data that caused the error.