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

print parameter in the page header

Status
Not open for further replies.

unknownly

Programmer
Jul 7, 2003
181
US
Using CR 8.5

In a report I need to print the selected parameter. which is a
'*' for all values, mutliple or single value.

How can I print the parameter on the page header as the user selected.
For example I need it to print as
IF user select ?state = '*' then print 'All Values'
if user select ?state = 'D' and 'F' then print 'Multiple selection'
if the user select single value ?state = 'D' then print 'Draft'

Please help I tried to do a simple if then else formula

but I get a array error

TIA,
Sweetie

 
Hi.
You could try:

IF {?state} = '*' then 'All Values'
else if join({?state},',') like '*D*F' then print 'Multiple selection'
else 'Draft'

By using the Join command you are bringing together all values in the array into a searchable string. Place this formula in the header and everything should be good.

Hope this helps.
ShortyA
 
Thanks, It worked. I tried Join in my formula but I didn't know how check it "like '*D*F'
 
Don't know what I was thinking. But it didn't work for Multiple selection...when I select more than one value for the parameter

Here is what Iam doing

IF
{?!invoiceStatus} = '*'
THEN
'All Invoices'
else
if
{?!invoiceStatus} = 'D' then 'Draft'
else if
{?!invoiceStatus} = 'F' then 'Final'
else
if
{?!invoiceStatus} = 'P' then 'Approved'
else if

{?!invoiceStatus} = 'S' then 'Interface'
else
if
count({?!invoiceStatus}) > 1
then 'Multiple Invoice'
 
even my record select seems to work for multiplr selection

if {?!invoiceStatus} = '*' then true
else
{inv.invstatus} = {?!invoiceStatus}


please help.
 
I don't have access to Crystal Reports at the moment but any multiple selection parameter will be stored as an array. Therefore, your formulas will work fine until multiple values are selected. For your record selection formula it is good practice to say {MyField} IN {?MyParameter} to support multiple parameters.

In terms of your actual formula I would drop the following part: f
count({?!invoiceStatus}) > 1
then and just leave "else 'Multiple invoice'
ShortyA
 
even my record select seems to not work for multiple selection

if {?!invoiceStatus} = '*' then true
else
{inv.invstatus} = {?!invoiceStatus}


please help me find what Iam doing wrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top