Crystal Report Question - Specifically for Page Header

SUGGESTED

Hi all,

I am working on a report, somehow got stuck.

Here is the simplified yet detailed description of the problem.

I created two formula out of OESHIHO table:

formula A: if {OESHIHO.OPTFIELD}='A' then {OESHIHO.VALUE} else ''

formula B: if {OESHIHO.OPTFIELD}='B' then {OESHIHO.VALUE} else ''

OESHIHO.VALUE contains both A and B.

I inserted these two formulas in Page Header. But when refreshed, only one of the formula shows value, the other is blank.

How do I get both value appear on Page Header?

Please help! 

Thanks.

  • 0
    SUGGESTED
    Crystal only works on one line at a time. If you want it to display two things, you have to create a variable with both results defined in the one variable. This variable will contain both of the results from formulas A & B

    for example (in the formula field that contains formula A & B):

    [start of your formula field]
    stringvar FormResAB:="";

    if {OESHIHO.OPTFIELD}='A' then
    FormResAB:= "Formula A: " & totext({OESHIHO.VALUE});

    if {OESHIHO.OPTFIELD}='B' then
    if FormResAB = "" then
    FormResAB:= "Formula B: " & totext({OESHIHO.VALUE})
    else
    FormResAB:=FormResAB & " AND Formula B: " & totext({OESHIHO.VALUE});

    FormResAB;
    [end of your formula field]


    This will give you what you are looking for as a result (Assume formula A value = RED and formula B value = BLUE):
    "Formula A: RED AND Formula B: BLUE"
  • 0
    Another option is to use an alias where you link in the optional field table twice into your report. One for linking to the first optional field and one for linking to the other optional field. That way your one header record will have access to both optional fields at the same time.
  • 0 in reply to Django
    Thank you all.

    I used "alias" method and it worked beautifully.

    Cheers,