Data not be displayed if record does not exist in the database table

Posted on 2006-05-20
Last Modified: 2008-02-26
I am trying to use crystal reports in a windows application. Below is the formula which i am trying to display.

1. "Dr." + {Print_Patients.Pdfname} + ' ' + {Print_Patients.Pdlname}

2. {Print_Patients.Pdcity} + "," + {Print_Patients.Pdprovince}

3. {Print_Patients.Pdpcode}

It works completely fine, however i want it to check if the record exists in the database then display all the information as specifed by the formula above. However, if Pdfname and Pdlname does not exists then it should not display anything for formula (1) and thus should just display formula 2 or 3 if the corresponding attributes have values in the database table. How can i do that?

Question by:janjuama84
    LVL 77

    Accepted Solution

    Hi janjuama84,

    if isnull({Print_Patients.Pdfname} ) and isnull({Print_Patients.Pdlname}) then
     "Dr." + {Print_Patients.Pdfname} + ' ' + {Print_Patients.Pdlname}

    Do the same sort of thing for the others.

    LVL 1

    Author Comment

    Hi that works, only thing that is left is if the result of first formula is empty then i want formula 2 and 3 to move up  when the result is displayed in the crystal viewer. How can i manage that? For example, if result of 1 and 2 is null then only 3 should be displayed (which works), however since all three formulas r in different sections a,b,c respectively. I want formula 3 to move two sections up if only formula 3 has value.
    LVL 77

    Expert Comment

    If you have put these 3 formula in different sections on their own then you just set the section property 'suppress blank'  for each section.


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
    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…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    728 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

    23 Experts available now in Live!

    Get 1:1 Help Now