Print Page | Close Window

Add Parameter

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22090
Printed Date: 05 May 2024 at 2:08pm


Topic: Add Parameter
Posted By: CrystalGirl
Subject: Add Parameter
Date Posted: 20 Sep 2016 at 5:24am
Hello,

I am trying to add three of of these fields (Score_#1_Pass, Score_#2_Pass, Score_#2_Pass) below a report parameter. Here are the fields from a table.

Student_Name Score_#1_Pass Score_#2_Pass Score_#2_Pass     
Andy          Y          Y          N
Steve          Y          N          Y
Jack          Y          Y          Y
Linda          Y          N          N
Marry          N          N          Y
Sam          Y          Y          N
Leo          Y          N          Y

What I am trying to do is to make a score parameter, so when I open
the report, the parameter will have three values, Score_#1_Pass, Score_#2_Pass, and Score_#3_Pass and they are only set to Y. So when I chose value of Score_#1_Pass, it will only give me all Student with Y passing. The same option for Score_#2_Pass, when
Select Score_#2_Pass, it will give me student with Y passing score of Score_#2_Pass.
If I choose Score_#3_Pass, it will give me student with Y passing.

So the parameter will have three values:
Score_#1_Pass
Score_#2_Pass
Score_#3_Pass

How do I achieve this?



Replies:
Posted By: hilfy
Date Posted: 27 Sep 2016 at 7:14am
Try this:

1. Create a parameter with the following information:

Name: Passing Score
Type: String
List of Values: Static
Add the following values to the list of values:
    "Score #1"
    "Score #2"
    "Score #3"
Prompt Text: "Select the passing score to search for:"
Allow Custom Values: False
Allow Multiple Values: False

Leave all of the other parameter properties at their default values.

2. Put something like the following formula in the Select Expert in addition to whatever other criteria you may have there (parentheses are very important here!):

(
({?Passing Score} = "Score #1" and {Table.Score_#1_Pass} = 'Y')
OR
({?Passing Score} = "Score #2" and {Table.Score_#2_Pass} = 'Y')
OR
({?Passing Score} = "Score #3" and {Table.Score_#3_Pass} = 'Y')
)

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window