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!

Filtering Report Data from Windows FrontEnd

Status
Not open for further replies.

Kobojunkie

Programmer
May 28, 2008
16
Hi,

I am working on a report that allows users to enter values that I can filter my data with. I would like a function that handles the above situation. How do I write such a report please? Thanks in advance.

A) If the User does not select a year Or a CaseType , Run the GET ALL @Year and ALL @CaseTypeDescription -? DEFAULT CASE

B) If The User Selected a Year, Run the FilterBy year StoredProc

C) If User Selected a Year and a CaseType, Run the Filter By @Year and @CaseTypeDescription

D) If the User Selects a CaseType but Not a year, Run the Get All @Year Where CaseType = @CaseTypeDescription Option
 
1. In your report, create parameters for Year and CaseTypeDescription.
2. Create a formula for each parameter that goes something like this:
{?Year} = 'ALL' or {table.year_field} = {?Year}
3. Add the formulas from step 2 to your Select Expert with "Is True".
4. In your code that runs the report, set the two parameters, using "ALL" as a default if the user does not enter a value.

Crystal cannot connect to different stored procs based on the parameters. However, you could do one of two things:

1. Create a separate stored proc that is a wrapper for the stored procs you want to use. Based on the value of the parameters ("ALL" vs. a value) it will call the correct stored proc and return that result set.

2. Create a single stored proc that handles all of the possible parameter combinations.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top