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!

Parameters in Crystal Reports 2008.

Status
Not open for further replies.

prgmrcr

Programmer
May 11, 2009
56
US
Hello Members,
I have a report in CR 2008 version. The scenario is, there are 2 columns in the database, one is doingbusinessname(dba) and the other is account name. Each account is recognized with account name as well as dba. User wants 2 parameters that takes mutliple values in the report to select either dba name or account name i.e. he can select
1.dba name and account name
2.dba name (skip selecting the account name)
3.account name (skip selecting the dba name)

Note:In some cases dba and account name are different.

How can we achieve this in CR ?

Please help me out regarding this issue.

Thanks in advance.
 
Hi,
just test for each possibilty in your record selection formula - Set a default value of 'ANY' for each parameter One way to do that:
Code:
If
({?dbaparam} = 'ANY' AND [?acctparam} = 'ANY' )
then
True
Else
If
( {?dbaparam} = 'ANY' and {?acctparam} <> 'ANY' )
Then
{Table.accountname} = {?acctparam} 
Else If
( {?dbaparam} <> 'ANY' and {?acctparam} = 'ANY' )
Then
{Table.dbaname} = {?dbaparam}
Else
({Table.dbaname} = {?dbaparam} and {Table.accountname} = {?acctparam})




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi Turkbear,
Thanks for the reply. I can write that formula in the selec tion criteria. The problem is the prompt screen is not letting me to skip to enter a value. For example, when the paramater prompts the user to enter dba name and account name on the paramater screen, user should be able to select dba name or account name or both. If user didnt provided a value for account name but entered a value for dba, the prompt screen should go away and the report should be run according to the user specified value.
 
Hi,
All parameters defined in a report will prompt for a value -if a Default value is created, no entry need be made but it will still appear and have to be acted on, if only to accept the default -
Although I have not used CR2008, in previous versions there was not a way that I found to prevent this behavior.




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Check out the HasValue() function in CR2008.

It allows for a blank value in a parameter.

It's new in 2008 and will cause errors if the report is created in 2008 and run in Xi.
 
Create a parameter field for each field (Dynamic). Then in the Report>Selection Formula>Record write in a formula to choose only records based on that parameter field. For example:

Field to base parameter on: {dba name}

Parameter field created: {?database.name}

Record selection formula: {dba name} = {?database.name}

 
Forum Members,

Thanks for the replies. All these replies helped me to solve this problem. In CR there is a setting in parameter creation window called " Optional Prompt". So I changed the setting for that nad used has value function. Thanks a lot for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top