Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stuck on simple formula

Status
Not open for further replies.

rahartigan

Technical User
May 10, 2012
5
US
Hello,

I'm stuck with something I thought would be pretty simple. I have a formula that works that concatenates the fields together and only displays BusinessName if there is one. I have one record for defendant name and one record for plaintiff name.

I have the following fields:
BusinessName
FirstName
LastName
MiddleName
SuffixName

Now, what I want to do is print on the report the name information for the plaintiff and defendant seperately in one row using the formula below.
----------------------------

WhilePrintingRecords;

Global stringVar Name;

if not IsNull ({Civil_Name.Business_Name}) THEN Name := {Civil_Name.Business_Name}

else Name := {Civil_Name.Name_Last};

If not isnull ({Civil_Name.Name_First}) THEN Name := Name & " " & {Civil_Name.Name_First};

If not isnull ({Civil_Name.Name_Middle}) THEN Name := Name & " " & {Civil_Name.Name_Middle};

If not isnull ({Civil_Name.Name_Suffix}) THEN Name := Name & " " & {Civil_Name.Name_Suffix};

Name := TRIM(Name);
Name;

Thanks in advance!
 
sort on the field that has "plaintiff" and "defendant" which will mean the defendant is first. Group by Case and put your fields in the Group Footer. The formula above will show the plaintiff. Then do a separate formula that is identical but has every field entered as:

Previous ({field})

This will pull from the previous record which should be the defendant.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top