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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MVP needed for If, Then, Else

Status
Not open for further replies.

bld21

Technical User
Mar 1, 2010
49
US
I am using crystal reports 2008. I am looking for a solution or a direction on how to solve this task.

I am working on a letter and in the letter there are 2 lines of text below:

X Vehicle was sold in state prior to January 1,____to:
@titlename, @titleaddress, @titlecity and

X Vehicle was sold out of state prior to January 1,__to:
@titlename, @titleaddress, @titlecity

Is there a way to have the first group print in the letter only if the state = KY and if so, then the second line would print nothing at all.

Or if the first line is not = KY print nothing then print the second line with the state other than KY.

Also the X was hard coded into the letter previously and if there is a way to print that when the line prints would be helpful.

I am thinking maybe the 3 formulas should be combined into one large formula and then print only if the criteria of KY is met. But I am unsure of how to get started.

Any direction is greatly appreciated. This will test the best......

Thanks,
Bruce D.

Any
 
Put each line in a separate details sections.

set each details section suppression x+1 formula to only display the one needed.

For example.
in details A's suppression formula you could use something like this:
{table.StateName} <> "KY"

and for the second details sectons:
{table.StateName} = "KY"


You could also write a formula to display differently based on the state, something like:
IF isnull({table.StateName}) then ""
else
IF {table.StateName} = "KY" THEN "KY Vehicle Info Here"
else "Non-KY Vehicle Info Here"

 
Please show the content of your formulas. In what report section are you placing the letter? You appear to be using the same formulas for both in and out of state, so what field distinguishes in/out of state and how does it display?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top