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

Moving report criteria to report header 1

Status
Not open for further replies.

drgsolutions

IS-IT--Management
May 23, 2007
7
0
0
US
I'm using Crystal Reports 11/XI

I have a report that has 7 parameters which a user can select any or all. I would like to show the user's selection criteria on the report or page header. I wrote the following into a formula that was in that report header.

If {?Gender} <> "All" Then "Gender; " & {?Gender} and

If {?Sponsor} <> "All" Then "Sponsor: " & {?Sponsor}

But got this error

"A boolean is required here" with the "Gender; " & {?Gender} section highlighted. It works fine with only a single IF statement but has problems when you add multiple IF statements; does anyone know why?
 
Yeah, your syntax is off...

Don't gang it all in one formula, use several formulas.

Here's my FAQ on this:

faq767-5684

If you're bent on doing it all in one formula, then code it accordingly:

whileprintingrecords;
stringvar Output:="";
If {?Gender} <> "All" Then
Output:=Output & "Gender; " & {?Gender} & chr(13);
If {?Sponsor} <> "All" Then
Output:=Output & "Sponsor: " & {?Sponsor};
Output

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top