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!

[b]Can't get Parent + Child Parameters to work Side by Side[/b]

Status
Not open for further replies.

Nassy

Programmer
Mar 27, 2003
121
GB
Hi

I have a report showing counts of Applicants by Office and by Region. I have defined two parameters:

[ul square]
[li]Region[/li]
[li]Office[/li]
[/ul]

These two parameters are also groups in my report with Region as the outer group and Office as the inner group.

What I want is to be able to filter the information by Region and then by Office ie I would like to see the following behaviour when I preview after having entered new values for the report:


1)If I select a Region but no offices I want to be able to
see data for all the offices in that Region

2)If I select a number of Offices I want to be able to see all those offices depending on the Region selected.

The idea behind this is to give the user a choice between filtering the data on region or on office as some users want to see the data by region whereas as other would like to be able to select only a few offices from different regions may be.

The problem I am encountering:

Despite the fact that the Region parameter is defined first when I come to preview the report Crystal doesn't show anything if I just select a region but don't select any offices. The only way data is shown is when I specifically choose the offices I want to see. This is not how I'd like it to work. However (and this I really don't get) if I select the region with the first office in the list Alton the data for Alton appears (but none of the other offices in the same region appear with it.

I am viewing the report using the Data Link Viewer by Millet Software but this does not seem to make any difference. The only other thing to note is that I have a 'dummy' table containing a list of all regions and offices and do a left outer join to the main table listing all the applicants so that the report shows groups with 0 value.

Any help much appreciated on this one as I will have to design many reports with parameters where one is the subgroup of the other[ponder]

Nassy

 
You haven't supplied your current selection formauls.

ok, you need to create a default parameter value, something like *.

Then place in your records selection formula :

(If {?RegionParam} <> "*" then {Region} = {?RegionParam} else true) and
(If {?OfficeParam} <> "*" then {Office} = {?OfficeParam} else true)

See how you get on then post back ...

Reebo
 
That was a lightening quick response Reebo. Thanks for that.

I have tried out the solution. I still cannot get offices to be displayed if I only select a region but I can counter this now by selecting the region I want to see and then just selecting * when I prompted to select the different Offices. This is a whole lot better than forcing users to select the offices that make up the region they selected.

Although I would prefer it slightly if you could just select a region and ignore the office parameter to bring up the offices in that region, the use of the * default parameter is a great workaround and involves hardly any effort by the user viewing the report.

Thanks Reebo you are a star!

Nassy
 
I did similar query using facility (region in your case) and costcenter (office in your case), using the following formula. Try it... If have any problems let me know.


The below assume, you would always have default empty string added as of the office location.


If (
(Count({?costCenterNumber}) = 1 and {?costCenterNumber}[1]=" ")
) then
(
If {?Facility} = 10 then
{Authorization_NABR_WKSHT.facility} in [10]
Else If {?Facility} = 20 then
{Authorization_NABR_WKSHT.facility} in [20]
Else If {?Facility} = 21 then
{Authorization_NABR_WKSHT.facility} in [21]
Else If {?Facility} = 22 then
{Authorization_NABR_WKSHT.facility} in [22]
Else If {?Facility} = 23 then
{Authorization_NABR_WKSHT.facility} in [23]
Else If {?Facility} = 24 then
{Authorization_NABR_WKSHT.facility} in [24]
Else If {?Facility} = 30 then
{Authorization_NABR_WKSHT.facility} in [30]
Else If {?Facility} = 40 then
{Authorization_NABR_WKSHT.facility} in [40]
)
Else
(
{Authorization_NABR_WKSHT.cost_center_code} in
{?costCenterNumber}
)


Hope this helps!!!
 
Thanks Spedi. I will have a look at your suggestion.

Nassy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top