Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

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

I am trying to use crystal reports in a vb.net 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?

0
janjuama84
Asked:
janjuama84
  • 2
1 Solution
 
peter57rCommented:
Hi janjuama84,
1.

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


Do the same sort of thing for the others.

Pete
0
 
janjuama84Author Commented:
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.
0
 
peter57rCommented:
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.

Pete
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now