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!

Suppress Formulas 3

Status
Not open for further replies.

cyreports

Programmer
May 12, 2010
89
0
0
US
In my report, I have 3 detail sections.

On Details A, I have a English letter.
On Details B, I have a Spanish letter.
On Details C, I have a Somali letter.

What I need is to pull the letter based on the patients language.
My field name is {data.PrefLang}. If the patient has a value not equal to any of these, I need it to pull the English version.

Any help is appreciated.
 
Hi,
Use 3 supression formulas ( 1 for each detail section:

For A
{data.PrefLang} <> "English" and Not IsNull({data.PrefLang}) and
Not ({data.PrefLang} in ["Spanish","Somali"])

For B
{data.PrefLang} <> "Spanish"

For C
{data.PrefLang} <> "Somali"

Note: This is an example, you will need to use whatever the data is in the {data.PrefLang} field for the comparisons but the logic should work to only show the detail that matches the language or show English if none of the other 2 is present.




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
I may have user the wrong connective..
try this instead:

Code:
For A
{data.PrefLang} <> "English"
 OR
 Not IsNull({data.PrefLang})
 OR
Not ({data.PrefLang} in ["Spanish","Somali"])
[COLOR=green]//I think that this should only show this detail when the language is English or the field is NULL or the Languages are other than Spanish or Somali[/color]
For B
{data.PrefLang} <> "Spanish"

For C
{data.PrefLang} <> "Somali"

Suppression logic ( since it is a negative ) is someime difficult when dealing with multiple conditions.





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Turkbear,

I am not getting back my patients that have English as their language. I think this one will be the tricky one.
 
I think i would take a different approach. not necessarily better, maybe worse, but for certain different.

I would try using CASE in a formula then use the result of that formula to determine which letter is displayed.

something like this:
//{@CASE_language}
Select {data.PrefLang}
CASE "English" : 1
CASE "Somali" : 2
CASE "Spanish" : 3
Default : 1

then in the section expert for the details suppression formula, use soemthing like these:
for Details A {@CASE_language} <> 1
for Details B {@CASE_language} <> 3
for Details C {@CASE_language} <> 2



I do not have crystal in front of me to test anything, so i apologize if i have any typos, syntax error, or just messed it up.
 
Create a formula like this:

//{@Lang}:
if isnull({data.PrefLang}) or
trim({data.PrefLang}) = "" or
not({data.PrefLang} in ["Spanish","Somali"]) then
"English" else
{data.PrefLang}

Then use suppression formulas like this:

//det_a:
{@Lang} <> "English"

//det_b:
{@Lang} <> "Spanish"

//det_c:
{@Lang} <> "Somali"

-LB
 
Thanks to all that helped to get the issue resolved! Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top