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

Subreport Totals 1

Status
Not open for further replies.

YANKRAY

Technical User
Nov 7, 2003
283
Using CR 10.

I have a Main report that pulls records and groups them by Group 1 - Station (area where work is performed) and then Group 2 - Work Order (individual work records).

I select the Station and Customer Order number (the Customer who the Work Order belongs to).

The main report pulls records that were Complete Date in LastFullWeek.

This is my record selection for the Main Report;

{PEM_RAISE_TASKS_ALL.COMPLETE_DATE} in LastFullWeek and
{PEM_RAISE_TASKS_ALL.WORK_CENTER_NO} like {?Station} and
{PEM_RAISE_TASKS_ALL.CUST_ORDER_NO} like {?Customer}

The subreport data I have in the Group Footer 1B of the Main report and it has a total of hours charged in the LastFullWeek. It is a group total for the Station.


This is my record selection for the SubReport;

{TA_LABOR_INFO.WORK_PERIOD_DATE} in LastFullWeek and
{TA_LABOR_INFO.PLANT} = "20" and
{TA_LABOR_INFO.WO_RELATED} = "Y" and
{TA_LABOR_INFO.WORK_CENTER_NO} LIKE {?Pm-PEM_RAISE_TASKS_ALL.WORK_CENTER_NO} and
{WO_MASTER.CUST_ORDER_NO} like {?Pm-PEM_RAISE_TASKS_ALL.CUST_ORDER_NO}

My issue is that the total for the Subreport Station being passed to the main report will only be for one CUST_ORDER_NO even though two or more were selected in the Main Report.

All the Main Report data is correct and the SubReport when run as a stand-alone report obtains the correct result.

I have tried different placements of the subreport (from footer1B to footer1A and from footer1B to header 1B.

I have found that if I have the subreport in footer1B the total is of the Max Customer Order and if I have the subreport in header1B the total is of the Min Customer Order.

Any ideas on where I went wrong?

Thanks,
Ray
 
If you are linking on both group fields, then the sub belongs in group #2, not group #1. If you want the sub to summarize for the entire group #1, then remove the link based on the group#2 field.

-LB
 
Thanks for the reply LB.

My second link is not based on a grouped field in the Main report, but the selection parameter of Customer Order from the Main report.

My goal is to pull the station total subreport but only for the Customer Order(s) selected in the Main report.

When the report is set up to only link to the Group1 STATION, I get all the Customer Orders total from the subreport.
 
Insert a group on Customer Order in your main report and make it group #2, and place the subreport there and then the links on both fields should give you the correct results. I'm assuming that each customer order has multiple work orders that would fall under it, so that the groups would be Station #1, Customer Order #2, Work Order #3.

-LB
 
The initial report had only by station results but adding the Customer Order group works well also. All my results are showing correctly now.

Thanks for the help.

Ray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top