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

Keeping Subreport Groups Together

Status
Not open for further replies.

camidon

Programmer
May 9, 2000
268
US
I have two subreports on one report. I would like to know if there is a way to keep the groups on those subreports together.

Like if a group appears in the first subreport, I would like it to keep the same group from the second subreport with it.

Is this possible? I'm open to suggestions if anyone has a better way to do this.
 
The best way is to avoid using subreports and create SQL on the database.

If you're trying to assure that the data in each subreport breaks as with the Change Group->Keep Groups together functionality, the groups within the subreports are separate entities.

I'd suggest demonstrating the environment, perhaps someone can give you a better design:

Crystal version
Database/connectivity used
Example data
Expected output

-k
 
If the same group field is available in the main report, you could link each subreport to the main report group field and place each subreport in its own group header or footer section, e.g., GH#1a and GH#1b.

Or, you could create one of the subreports as a main report and link the other subreport by the group field in the main report.

-LB
 
Okay, here is some sample data. I'm using CE 8.5. I'm connecting via ODBC connection. Here is the data that I'm working with.

tbl_Tickets:
Ticket# OpenDate OpenedBy
38384 01/01/2004 Bob
38383 01/02/2004 George
38382 01/03/2004 Bob

tbl_WorkOrders OpenDate OpenedBy
3456 01/05/2004 George
3567 01/06/2004 George
3679 01/07/2004 Bob

What I would like to see is this:

Total tickets and work orders opened for each user:

BOB
Tickets
38384 01/01/2004
38382 01/03/2004
Work Orders
3679 01/07/2004

GEORGE
Tickets
38383 01/02/2004
Work Orders
3456 01/05/2004
3567 01/06/2004

Any ideas as to how I might pull this off. Also, there is no relationship between tickets and work orders.

Thanks,

Chris
 
The relationship between tickets and work orders is mediated by the user ({table.openedby}), so you would group on {table.userID} (or {table.openedby} if you are sure each name is discrete). The group field should be one that is available as a field in each subreport. Then put the ticket subreport in GH#1_a under the group name and the work order subreport in GH#1_b. Link each subreport to the main report on your group field {table.userID} or {table.openedby}, whichever you are using.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top