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

Parameter Issue

Status
Not open for further replies.

rb2005

Programmer
Mar 7, 2005
110
US
hi,

I want to create one parameter using Crystal Report 10, by default this parameter will bring everything but the user can edit it. Let say I have a parameter call Country, so that the report will display data for all countries but user can insert any country and display data for that specific country. Can anyone has any clue? I am not using stored proc. I am using a business view which I have created directly from the table.
I tried to put multiple value in parameter's dafult value and checked allow multiple value but it showing an error.
I would appreciate if someone can help me.

Ratna
 
Please don't post "but it showing an error", state what the error says and when it occurs.

Your methodology is close, here is what I suggest you do:

Fill the default values for the parm, but in additiona make the first choice ALL

In the report->Selection formulas->Record place a formula such as:

(
if {?MyCountryParm} <> "ALL" then
{table.country} = {?MyCountryParm}
alse
if {?MyCountryParm} = "ALL" then
true
)

Also make sure that you select Allow editing.

-k
 
do I have to check allow multiple value?
 
ALL is bringing nothing. Anyone can help me?
 
solved.It should be like this
(
if {?MyCountryParm} <> "ALL" then
{table.country} = {?MyCountryParm}
else
true
)

 
This is working fine. But I am trying to use this "ALL" for both main report and sub report but in that case the sub report bringing everything for all countries. I tried to remove my country parameter and in that case also the sub report is bringing everything for all countries. So For country A I can see all data for country A as well as other countries. Any one has any issue?


 
Try linking the subreport to the main report by linking your parameter in the main report to the country field in the subreport.

-LB
 
it's working fine for specific country not for all. I am getting same set of data for all county. My sub report is linked from the begining.
 
It is unclear what you are hoping to see. If you have linked the subreport to the main report on the country field and placed the subreport in the country group header or footer, then if the user picks two countries, you will see the subreport execute twice, once with each country's data. If they choose "all", then the subreport will execute once for each possible country.

Is your issue that you want only one subreport with all countries if the user chooses "All", but multiple subreports (one for each country) if they don't?

In additiona to answering this question, I think you should explain your group structure, where the subreport is located, and how it is linked to the main report.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top