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

Is it possible??? 2

Status
Not open for further replies.

UCFSteve

Programmer
Apr 14, 2005
11
US
I need to create 2 seperate groupings incapsulated by 1 parent group.

GH1
GH2
D2
GF2
GH3
D3
GF3
GF1
 
Group #3 would automatically be nested with Group #2. To get this kind of format, you could use subreports for "Groups" 2 and 3, placing them in separate Group #1 footer sections, and linking them to the main report on the Group #1 field.

-LB
 
I am unfortunately unable to use sub reports because I am using a trimed down version of cyrstal reports. The version I am using is routed through Rational Clearquest. So I will still need to find another way around this.
 
As long as Group #2 and #3 are based on separate fields, I don't believe there is another way of accomplishing this. If they are, in fact, two instances of the same field, then you would just insert a group on that field to accomplish your desired display.

-LB
 
Try posting technical information:

Crystal version
Database/connectivity used
Example data
Expected output

Keep in mind that Crystal only display data ONE time, so your design of 2 detail areas doesn't make sense. And GF2 would never come before a GH3, groups are nested, that's their purpose.

It sounds like what you're calling Group 2 and 3 are in essence one group, so perhaps a formula to be used as the inner group would work:

if {table.field} = <somevalue> then
1
else
2

-k
 
Unfortunately that is the case they are 2 seperate fields.
 
Crystal Version - 8.0
Database - ClearQuest MSSQL
Example Data - Field Names: Class & Attendence & Tests
Expected Output -

Group Header (Class)
Group Header (Attendence)
Details Attendence.Name
Group Footer
Group Header (Tests)
Details Tests.Type
Group Footer
Group Footer
 
That doesn't matter, combine the fields into one field.

It's a shame that you don't want to supply example data and required output instead of just reposting what isn't possible in SQL or Crystal.

Crystal 8 is quite old, so you'll have to use a trick to fix the data.

First, pull in the fields as you normally would, including the Attendance field (but not the Tests field).

Go to Database->Show SQL Query and at the end of the demonstrated query type UNION ALL

Now copy and paste the existing query after the Union all and change the Attendance column to the tests column.

You'll now have all of the data duplicated, yet the attendance and tests field will be combined, so you can group on it.

-k
 
Example Data:
Record 1- Class: CS Attendence: Steve Test: C++
Record 2- Class: CS Attendence: Joe Test: C++
Record 3- Class: CS Attendence: Mary Test: Java

Output:

Class: CS
Attendees: Steve
Joe
Mary
Test: C++
Java


P.S. I do not have the capability to Show SQL Query using Crystal through ClearQuest, It has been disabled.
 
Yeah, you're looking to duplicate data here, which isn't how Crystal works.

It's a bad database design I guess, and you'll need to do something on the database, perhaps you can create a Union All View:

select 'Class" MySource, Class, field2, etc... from table
union all
select 'Test" MySource, Test, field2, etc... from table

This will provide the data duplicated and you can group by the MySource column.

-k
 
Should be:

select 'Class' MySource, Class, field2, etc... from table
union all
select 'Test' MySource, Test, field2, etc... from table

Quotes were wrong.

-k
 
If you can't do the union (good thought, SV), you could either:

1) add two crosstabs into the class group footer, one which uses test as the row, and one which uses name as the row, with no column field. Use "maximum" as the summary in each case. Then suppress the row label and remove the grid lines. Or,

2) collect the names in a detail level formula that you then display in the group footer:

//{@reset} to be placed in the group header:
whileprintingrecords;
stringvar name := "";
stringvar test := "";

//{@accum} to be placed in the detail section and suppressed:
whileprintingrecords;
stringvar name := name + {table.name} + chr(13);
stringvar test := test + {table.test} + chr(13);

//{@displayname} to be placed in a group footer_a section:
whileprintingrecords;
stringvar name;
"Attendees: " + name

//{@displaytest} to be placed in a group footer_b section:
whileprintingrecords;
stringvar test;
"Test: " + test

Format each of these last two to "can grow" (format field->common->can grow.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top