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

Crystal Reports - how to display all prompts I input?

Status
Not open for further replies.

bessebo

IS-IT--Management
Jan 19, 2001
766
US
I would like to be able to display in the header of the report all of the prompts that were entered into the report when it was run. If an input parameter allows MORE THAN ONE values to input. If I put that parameter field on the report it will only give me the first parameter that I input even though the report will print all of the data associated with all parameters input. Is there a special field that will capture all of those parameter values that I just input into the report? Or is there a way to build a string of the values that I just inputted into the report so I can display them on a header?
This is only a problem when there is a parameter that allows more than one value to input.

Thanks in Advance,
Bessebo
 
I don't know your version, but if your version is compatible with the Join function, use it like this:

Join({?My Parameter},', ')

Naith
 
Naith,
Can you be a little more descriptive in what you are saying. If I wanted to create a formula which will be put in the header should I do the following?

'These are my inputs...' + Join({?My Parameter},', ')


REgards,
Bessebo

I cannot get the above to work...
 
That's exactly how it should look, providing all the above is in a formula.

You still haven't mentioned your version of Crystal Reports, so I'll assume that Join is a supported function for you.

When you say that you 'can't get it to work', exactly what kind of error are you getting?

Naith
 
This is exactly how I put it in the formula:

'(Inputs for report + ' + Join({?Cust_Code},', ') + ')'

where {?Cust_Code} is my input variable. The error I get is the following:

"A number, currency amount, boolean, or string is expected here." The cursor sits right in front of the Join. I use Crystal Reports 7 and I find nothing in the Index that talks about a Join operator...

When I try to use the ToText function in front of the Join it tells me "The ) is missing".

Can you do this in your Crystal Reports designer and then send me the code?

Thanks,
Bessebo
 
Providing {?Cust_Code} is a string parameter, what you posted would work in my designer.

But then, that's why it's good to post what version you're on. Because the reason it'd work for me and not for you is because I'm on v8.5 and you're on v7. Join was introduced in v8.

You will have to make an array for your parameter to mimic the join functionality instead. It's a little longer winded but does the same thing:

You'd probably have to use an array to check the number of values in the parameter instead.
Code:
WhilePrintingRecords; 
NumberVar ValueCount;
StringVar Array ParameterArray := {?MyParameter};

ValueCount := Count({?MyParameter});

ParameterArray[1] + 

(If ValueCount > 1 Then ', ' + ParameterArray[2] + 
 If ValueCount > 2 Then ', ' + ParameterArray[3] + 
 ... etc)
...keep going for as many values as you want to represent.

Naith
 
Naith,
You are the man. It works like a charm. Thanks so much...

Bessebo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top