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

Using A Parameter field to change grouping

Status
Not open for further replies.

pleashelp

Technical User
Feb 27, 2002
97
US
Using CR 8.5 . Have a parameter set up to allow user to change grouping in report. The formula looks like this:

if {?GroupBy}= "Manufacturer" then {VLT.STRMANUFACTURERID}
else if {?GroupBy}= "Model" then {VLT.STRMODEL}
else if {?GroupBy}="Program" then {VLT.STRPROGRAMNAME}
else if {?GroupBy} = "Denomination" then
totext{VLT.IDENOMINATION})

I then use this formula as a row in a cross tab report.

This part seems to be working. NOW, I need to be able to allow the user to choose multiple groups from this formula. Is this possible? if so, how? I am stumped!

Thanks in advance!
 
do you mean generate one report on the basis of Manufacturer and another on the basis of model in succession

Crystal does only one pass through the data so unless it is easy data to collect and store for printing in a footer...I am afraid the user must do one report type at a time.

Jim
 
What I get out of this post is that you'd like to allow the users to select multiple groups within the report? You'd need to create one formula per group up to the number of allowable groups.

Example: If you want to allow up to 3 possible groups then you'd have to create three formulas. You'd then base a group upon each one of these three formulas. This will be easier for you if you require three groups. If you allow only one group to be selected (leaving the other two parameters blank, for example) then you'll need to account for this in your formulas.
 
Yes... I want to allow multiple groups within the report, but NOT necessarily all of the groups. As long as all of the groups are chosen, it works. But when the user doesn't want one or more of the groups, it dies.(For instance, if the user ONLY wants to group on Program or only on Model and denomination.) Any Ideas?
 
I have done this before....but it cannot be done in a single group.

When I did it I set up for three grouping Which I termed as sortings to the user. I had 3 parameters called
{?PrimarySort}, {?SecondarySort} and {?TertiarySort}

Each parameter had the same options and the user was advised to select unique options for each sort. To eliminate a grouping you just have it select a constant and if they made a duplicate choice then it would default to that constant.

With 5 choices it becomes even more complicated but is doable.

Another issue is what the look of the report will be shown with each selection selection. You can thereby create many "report" looks depending on the parameter selection.

This type of report requires a lot of thought before beginning because of it's complexity.

I can help you if you wish

Jim
 
Thanks to ngolem. I 'think' I'm going in the right direction. I have a formula for each possible grouping. @Form1,@Form2,@form3,@form4. So far, so good. If I understand what you are saying...if the user chooses an item from each of the first 3, he should then choose a duplicate item for the 4th grouping.(?)

By the way, I am using all of this in a cross tab report, and have set each of the formulas as a row. Am I heading in the right direction?!

Thanks.
 
sounds like you are heading in the right direction.

I don't like CR's crosstab report I make my own crosstabs manually so I might not be able to help much there.

But here is what I would do for the formulas...I'll give one as an example...and we have 4 Parameters for sorting
{?Sort1), {?Sort2), {?Sort3), {?Sort4)

So...you will have 4 groups

Using your example

?Sort1
type: string
description: Primary Sort - Type "1" for manufacturer, "2"
for Model, "3" for Program, "4" for
Denomination or "5" for NO SORT
Default value: "5"

the other 3 parameters will be the same...but warn the user about not duplicating the choices...with the exception of NO SORT...all parmeters should be unique

Now...the grouping formula Form1

@Form1

if {?Sort1} = "1" then {VLT.STRMANUFACTURERID}
else if {?Sort1} = "2" then {VLT.STRMODEL}
else if {?Sort1} = "3" then {VLT.STRPROGRAMNAME}
else if {?Sort1} = "4" then totext{VLT.IDENOMINATION})
else "No Sort1";

this one is easy since no comparison neccessary now the second formula Form2

@Form2

if {?Sort2} = {?Sort1} then "No Sort2"
else if {?Sort2} = "1" then {VLT.STRMANUFACTURERID}
else if {?Sort2} = "2" then {VLT.STRMODEL}
else if {?Sort2} = "3" then {VLT.STRPROGRAMNAME}
else if {?Sort2} = "4" then totext{VLT.IDENOMINATION})
else "No Sort2";

here we test to see if the user has duplicated a parameter choice...if they have then we assign a constant ("No Sort2") so that no sorting (ie. grouping) will take place.

You will make the other group formulas in a similar manner.

I don't know how these "constant" groups will affect your crosstab report. Like I said I don't like the CR Crosstab format so I don't use it.

I hope this sets the wheels straighter on the track :)

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top