Skip to Content
avatar image
Former Member

How to write multiple actions in if else crystal reports

Hello

I'm tyring to write following code in a formula and its throwing error. Can someone help in this. I need a count variable to count the number of lines printing in the detail to add to string that is being used in trailer.

Shared Numbervar count;

if {APY2055.PYMNT_STATUS} ='P' THEN

('300'+{@transit_nbr} + right({@account_number},7) + {@check_number} + {@check_amount}+ {@Client_ref_space} +{@filler_53to60}+{@check_dt}+ {@filler_67to80};

count:=count+1)

ELSE IF {APY2055.PYMNT_STATUS} ='S' THEN

('311'+{@transit_nbr} + right({@account_number},7) + {@check_number} + {@check_amount}+ {@Client_ref_space} +{@filler_53to80};

count:=count+1)

Thanks

Mano

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 09, 2014 at 10:09 PM

    Hello Mano,

    I hope the error might be concatenate the string values not the other types and provide more details please

    Thank,

    DJ

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Mano,

      See if this works:

      Shared Numbervar count;

      if {APY2055.PYMNT_STATUS} ='P' THEN

      (

      count := count + 1;

      '300'&{@transit_nbr} & right({@account_number},7) & {@check_number} & {@check_amount}& {@Client_ref_space} &{@filler_53to60}&{@check_dt}& {@filler_67to80};

      )

      ELSE IF {APY2055.PYMNT_STATUS} ='S' THEN

      (

      count := count + 1;

      '311'&{@transit_nbr} & right({@account_number},7) & {@check_number} & {@check_amount}& {@Client_ref_space} &{@filler_53to80};

      )

      -Abhilash