Define Case Expression

Anyone know that:

Can I define Case expression inside Menu-->Report-->Variables, such as crystal report as below:

SELECT {FIELD A}
CASE '1':
IF {VENDOR.CNAME} <>'' THEN {VENDOR.CNAME} ELSE {VENDOR.ENAME}
CASE '2':
IF {DEBTOR.CNAME} <>'' THEN {DEBTOR.CNAME} ELSE {DEBTOR.ENAME}
CASE '3':
'No Related Information';

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:19AM
    i have never tried a case statement in a variables expression
    but you can write it in the obp event of the memo or band to fill the text of the memo with the correct
    expression note the apostrophes and []
    delphi code sample
    case <integer value>of
    1:
    IF {VENDOR.CNAME} <>'' THEN memo1.memo.text :='[VENDOR."CNAME"]' ELSE memo1.memo.text := '[VENDOR."ENAME"]'
    2:

    3:

    end;
  • gordkgordk St.Catherines On. Canada.
    edited 11:19AM
    i have never tried a case statement in a variables expression
    but you can write it in the obp event of the memo or band to fill the text of the memo with the correct
    expression note the apostrophes and []
    delphi code sample
    case <integer value>of
    1:
    IF {VENDOR.CNAME} <>'' THEN memo1.memo.text :='[VENDOR."CNAME"]' ELSE memo1.memo.text := '[VENDOR."ENAME"]'
    2:

    3:

    end;

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.