Crystal Reports if statement

Posted on 2007-10-12
Last Modified: 2011-10-03
Can you have more then one if statement in a formula in Crystal Reports 8.5?
IF InStr ({@Footnote},"A") < 1 then
    '* A = Abnormal' + chr(13)  
IF InStr ({@Footnote},"H") < 1 then
    '* H = High' + chr(13)  
and so on.....
Question by:sborchers
    1 Comment
    LVL 100

    Accepted Solution

    Yes.  How you do it depends on the result you want.

    Will only one of them be true? Try it this way

    IF InStr ({@Footnote},"A") < 1 then
        '* A = Abnormal' + chr(13)  
    ELSE IF InStr ({@Footnote},"H") < 1 then
        '* H = High' + chr(13)  

    If you want multiple lines then do it this way
    Local StringVar strResult := '';
    IF InStr ({@Footnote},"A") < 1 then
        strResult :=  strResult  & '* A = Abnormal' + chr(13)  
    ELSE IF InStr ({@Footnote},"H") < 1 then
         strResult :=  strResult  & '* H = High' + chr(13)  
    ELSE IF LASTTest Then
         strResult :=  strResult  & '* Last' + chr(13) ;



    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now