Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grouping on a Field Value using a Parameter Query Post Reply Post New Topic
Author Message
lorif747
Newbie
Newbie


Joined: 24 Jan 2007
Online Status: Offline
Posts: 5
Quote lorif747 Replybullet Topic: Grouping on a Field Value using a Parameter Query
    Posted: 24 Jan 2007 at 3:57pm
I created a parameter query that is a dynamic picklist based on a field named 'AssignedType'.  From what I understand the list that will be presented to the end user will be a list of current distinct values in the AssignedType field (and there will be several).   Let's say in this client's database one of the values they might pick is 'Responsible Attorney'.  If they pick 'Responsible Attorney' I then want my report grouped on that value. 
 
I've done this sort of thing for interactively letting a user decide what fields they want to group a report on but I'm stuck on how to make this report group on choice of a value in a field.
 
Any help would be appreciated.  Thank you.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 24 Jan 2007 at 4:52pm
To create a report that groups by paramter, I would propose that you set a formula equal to the parameter field. Then group on that formula. But I"m a bit confused by your question and what you are grouping on. You say you want it grouped on 'Responsible Attorney', but it sounds to me like you are filtering the data to be equal to 'Responsible Attorney'. At first I thought you were saying that there is a field called 'Responsible Attorney', but in your second paragraph you say that you already know how to use a parameter to specify the field to group on. So I'm confused as to what you are letting them select and how it will be used to set the group.   Can you rephrase the question?
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
lorif747
Newbie
Newbie


Joined: 24 Jan 2007
Online Status: Offline
Posts: 5
Quote lorif747 Replybullet Posted: 25 Jan 2007 at 8:59am
So maybe I should be looking at this from a different angle but here's what I need to happen:
 
First I need to ask them whether the report should be grouped by assigned type.  If they answer yes, I then need to know which assigned type.  Doing a record selection at this point is probably the way to go.   So if they answer yes, I want to group by assigned type, then I would want another query asking them specifically which assigned type they want to include in the report and somehow get that answer used in record selection.
 
Forgive me the confusion, I am a newbie.
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 21 Aug 2007 at 2:59am
Hi,
 
Create a report and Group By Assigned Type.
 
Select Group Header right click select section expert  then in Supress (No DrillDown) Click the formula button and enter
 
<Static Parameter>='NO' and <Dynamic Parameter> = '...All'
 
Create 2 parameters
1)Static Parameter with Yes and No Values
2)Dynamic Parameter with Assigned Type
 
IN Group Selection Formula Enter
IF <Dynamic Parameter>='...ALL' Then
true
else
{table.AssignedType=<Dynamic Parameter>
 
So when you run the report user will be given two prompts to select from if the user selects Yes and All then the report will show all the records with Group Assigned Type.
 
If the User Selects No and All then no groups will be displayed.
 
If user selects Yes and Assigned Type the it will display the Group and Details for the Assigned Type Selected.
 
Hope that solves your problem.
 
Thanks
Rahul
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.015 seconds.