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

Using a multiple value parameter to show/hide groups

Status
Not open for further replies.

putts

Programmer
Dec 13, 2002
93
US
I have a report that is a simple list of groups and their subgroups. I also have a multiple value parameter that I need to pass in the groups that the user wants on the report.

For Instance:
Say the report is grouped by a City Field so you have group headers like:
Detroit
Dallas
Timbuktu
Los Angeles

And the user only wants to see Dallas and Detroit on the report. I pass in a string "Dallas,Detroit" for the multiple value parameter and want to only show those two categories.

Question #1: Is the value I send in correct with just comma delimitting or is delimitted another way?

Question #2: How do I only allow the groups to show that exist in this Parameter?

I'm using Crystal Reports 8.0

Thanks for your responses.
 
Question #1: Is the value I send in correct with just comma delimitting or is delimitted another way?

You don't delimit parameters, let CR do the work for you (see below). Create a multi parameter field.

Question #2: How do I only allow the groups to show that exist in this Parameter?

In the Record Selection Formula (Report->Edit Selection Formula-Record) place something like:

{MyTable.MyCity} = {?MyMultiParameter}

Replace these with your column and parmeter field names.

To check what Crystal has done with this, use Database->Show SQL Query.

This will be passed to the database for processing (increased performance).

-k kai@informeddatadecisions.com
 
Thanks so far but I'm still experiencing some difficulty.
Let me see if I can give more detail.

Let's say we have a report running off a table and the table looks like this:
|Country Code|Country|StateCode|State/Province|City
-----------------------------------------------------
1 | USA | MI | Michigan |Detroit
1 | USA | MI | Michigan |Grand Rapids
2 |Canada | ONT | Ontario |Ontario
2 |Canada | ONT | Ontario |Winser
1 | USA | NY | New York |Buffalo
1 | USA | NY | New York |New York
1 | USA | NY | New York |Albany

Now let's say my report looks this:

Country State City
USA
Michigan
Detroit
Grand Rapids
New York
Buffalo
New York
Albany
Canada
Ontario
Ontario
Albany

OK.
So now let's say the User (via the web) can select a country first and then select which State/Province(s) from that country they want to see and they Select USA and MI/NY
So the ASP passes a country code of a 1 and "MI NY" as the multi parameter.

On my Record Source I was putting {[CountryCode]} = {?countryParm} AND {[StateCODE]}={?StateParm}.
Where countryParm is a standard Parameter and StateParm is a multiple Value Parameter.

Is there anything I'm doing wrong?
Is there a way I can use the Group... record source option here?

Thanks again for all your help.
Long time programmer, first time Crystal Reporter.

 
Found It!!!!!!!!!!!!!!!!

After viewing a different article in this forum, I tried "in join" instead of "=" for my multiple value parameter and it worked.

Thanks for all the replies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top