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!

Multiple separate groups? 1

Status
Not open for further replies.
Aug 11, 2004
53
CA
CR10 from SQL2K

I'm pulling a list of transactions (see example below)
[tt]
Trans Type Referring Branch Amount
----------- ------------------ --------
Annuity Branch A $1000.00
RESP Branch B $4000.00
Seg. Fund Branch C $3000.00
RESP Branch C $7000.00
Annuity Branch A $2000.00
Annuity Branch B $9000.00
RESP Branch A $1000.00
Seg. Fund Branch C $3000.00
[/tt]
What I'd like to do is show the data grouped and summed by Trans Type, and then, in the same report, show the same data grouped and summed by Referring Branch. Is there a way to have indepedent groups in the same report with CR10?(ie. I don't want nested groupings, I want the two to be completely separate.)

Thanks for your help,
Jason
 
Jason,
First Insert a Group with Trans Type and then Insert a Group with Referring Branch....
It will look some thing like this:

Annuity : Branch A $1000
Branch A $2000
Branch B $9000
Total $12000
If you want Referring branch to be separate,just Hide the second Group and in the Preview on the First Page you will see Grouping based on Annuity and in the Drilldown you will see Grouping based on Referring branch.....

Hope this clears....
 
I'll explain a little further; I want the trans type breakdown to be independent of Referring Brancha nd vice versa. What I want the report to look like is somehting like this(using the data above):

[tt][bold]Trans Type[/bold]
Annuity $12000.00
RESP $12000.00
Seg. Fund $6000.00

Total $30000.00

[bold]Referring Branch[/bold]
Branch A $4000.00
Branch B $13000.00
Branch C $13000.00

Total $30000.00[/tt]

That's what I mean by keeping the groups separate. From your example, I get the feeling that you're grouping by Trans Type, and then grouping by Referring Branch within that group. I want the groups to be completely independent of each other.
 
It sounds like you misunderstand what a Group is.

Think of them as akin to a Group By clause in SQL. Groups have a hierarchy.

One solution would be to use a subreport.

The other might be to create a union query and bring the data in a second time. An example would be to use the Add Command in CR 10, and the SQL might look like:

select 'trans' type, field1, field2, field3 from table1
union all
select 'branch' type, field1, field2, field3 from table1

Now you can group by the type field and you'll have the same data twice which can be differentiated as 2 different data sources.

-k
 
I think the simplest approach is to insert several CrossTabs.
One of the nice things about CrossTabs is that they group data independently of how the report is grouped.

hth,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
If a cross-tab suits the requirements, then that's agreta idea, Ido.

Unfortunately they are summaries and have very few controls over the look and feel.

I generally avoid them.

-k
 
If a cross-tab suits the requirements, then that's a great idea, Ido.

Unfortunately they are summaries and have very few controls over the look and feel.

I generally avoid them.

-k
 
Thanks for your responses, the union query should fit my needs, unfortunately a cross-tab is a little too restrictive for use in this case. I will be looking a little deeper into subreporting, however. I'm fairly new to CR, andthere always seems to be somehting different I want to do with it, so thanks again for the help!
 
The Union Query will prove much faster than a subreport might, so if the Union works for you, use it.

-k

 
So, I've used subreports (putting each in a separate details section (a,b,c), but I have a small problem. I'd like to specify a date via a parameter that applies to all of the subreports (As of now, each of the three subreports has its own Date parameter which means I have to enter the same date 3 times. Is there anyway to provide some type of report-global variable that would be applicable via a formula to all of the subreports?
 
Create the date parm in the main report, and in the linking go from the main report date parameter to the date field in the subreport.

-k
 
I go into Subreport Links from the Edit menu and select the {?Date} parameter and put it into the "Field(s) to link to:" box for each of the three subreports. The the Subreport Parameter field to use: shows ?Pm-?Date in the drop down box. When I click OK in the Subreport Links window, it won't allow me to use the ?Pm-?Date parameter int he subreports, and if I go back into Subreport Links, the changes I'd made previously are no longer there. Any ideas?
 
The other way of doing this is to use a date parameter in the record selection formula within each subreport and then go to the subreport linking expert and for each subreport, move over the main report date parameter and in the bottom left corner, use the dropdown list to select {?date}, NOT {?pm-?date}. This will cause only one prompt to appear.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top