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!

Allowing Multiple Values on a Parameter???

Status
Not open for further replies.

jolie555

Technical User
Sep 26, 2002
22
0
0
US
[sadeyes] I need HELP! I am fairly new in creating complex crystal reports. And this may sound very basic but that is how new I am to this...

I have a report I am working on that has 4 parameters. I need two of these parameters to allow multiple values such as broker ID #'s and Vendors. Example, I want to be able to see what two specified brokers with two specified Vendors have sold within the last six months. When I added these parameters and elected to "allow multiple values" I noticed that it will allow the user to add multiple values in the prompt pop-ups, however, I get errors asking for an array?

Help!?!

Jolie

 
Not sure what you mean by "errors asking for an array".

Just use the parameters as you normally would in the record selection formula, Crystal will build and pass the SQL for you.

{MyTable.MyField} = {?MyParm}

Note that you don't have to use an IN, Crystal resolves this.

If you want to display what they entered in the multiple parms (assuming a string type), here's an example of displaying them, though it checks for the choice 'All' in the first position:

// Demonstrates the choices made for the Classification parameter
WhilePrintingRecords;
Local Stringvar Array InputValue := {?Classification};
Local StringVar lbl := " Classification: ";
Local StringVar str := "";
if InputValue[1] <> 'All' then
str := lbl + Join(InputValue, &quot;,&quot;) + chr(13);
str

-k kai@informeddatadecisions.com
 
The problem will identify a formula that has a problem with arrays. Sometimes this is not the formula with the problem, if a formula inside a higher level formula.

If X is a field and A is a multivalue parameter you can say:
if X = A then...

You cannot say
if X > A then .. // or any other condition

Be careful about Function(A) as some functions will like an array (Maximum, Minimum, Count, etc.) , while others do not . Editor and Publisher of Crystal Clear
 
Ok, I'm lost =(. Below is exactly what I have in my record selection formula. This does work if I only want information for only one agent # to display. Now what I need is to have the ability to put 2, or 3, agent #'s at one time using my parameter. I guess I am not familiar with vars or arrays. I get lost there. But this is what I have in my record selection formula:

{CARRIER.CARRIERCODE} = {?Carrier Code} and
{CLIENTINFO.DATEPLACED} >= CDate ({?Start Date}) and
{CLIENTINFO.DATEPLACED} <= CDate ({?End Date})+1 and
{AGENT.AGENTNBRID} = {?Agent Number}

When I run the report, it will prompt me for a start date, an end date, an agent #, and a Carrier code. I enter the dates, and when I get to the agent, I want to be able to enter 3 distinct agent #'s and 2 carrier codes. You may have answered this but i don't get it. sorry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top