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

Subreport not displaying data properly?

Status
Not open for further replies.
Apr 26, 2004
87
US
I have 1 Report that is grouped by department name. (department.level2). I have many details b-d that include subreports that are based on call type and date. Right now that selection expert says the following.

{CallRecords.DateTime} in DateTime (2003, 12, 10, 07, 24, 00) to DateTime (2003, 12, 11, 10, 11, 00) and
{Departments.Level2} = {?Pm-Departments.Level2} and
{Departments.Level2} = {?Pm-Departments.Level2} and
{CallRecords.CallType} in [8]

This is a phone bill type of report. The details a includes customer information and a summary of all calls.
the detail sections are phone logs, a is local calls, b is long distance, c is etc.etc.

My problem that i am having is that all departments display correctly but the call logs in the details (the sub reports) are showing the exact same data for each department?? is there a way i can choose in the select expert to make data = to the department in the group? How can i make each subreport details display correctly for each group or department?

MCSE 2K - MCSA 2K - NET+ - A+

Paul..
 
I'm guessing you are getting repeating displays for each detail in the main report. Try placing the subreports in group footer sections instead. It looks like your linking is correct, although you have one redundant (repeating) line which I think could be removed.

-LB
 
Thanks for the responce. I tried moving the sub report like you suggested to the group footer. I created Group Footer #1a,b,c and d and put them all in each footer. But still all of them are reapeted the details on each department instead of filtering just the department that it is grouped by. I also change the select expert so only 1 filter is displayed

{CallRecords.DateTime} in DateTime (2003, 12, 10, 07, 24, 00) to DateTime (2003, 12, 11, 10, 11, 00) and
{Departments.Level2} = {?Pm-Departments.Level2} and
{CallRecords.CallType} in [7]

what does ?Pm-Departments... what does the ?Pm mean?

MCSE 2K - MCSA 2K - NET+ - A+

Paul..
 
The {?PM-Departments.Level2} indicates that you have a subreport link on this field. In the main report, if you go to edit->subreport links->you should see that you have selected {department.level2} as the field in the main table to link on, and that the same field has been chosen as the field from the subreport to link on. Since you have done this, I wonder whether you might be choosing the wrong field to group on (and for the subreport link). Can you please verify that {department.level2} is the department name field by placing both in the detail section?

-LB
 
Ok all subreport links are correct for all 4 sections of the group footer. It has the link by {department.level2}. and the section below in the sub report link is also by {department.level2}. I placed the {department.level2} field in the details section of both the sub report and the main report. The subreport displays correctly. every different department i jump to on the main report, the sub report field {department.level2} also changes to match the department. (all records that show has the field {department.level2} in the record). There is also one field called level2 in the main form that displays the correct data with the subreport details.. But still, if i browse to different departments, the exact call logs appear for each one?? Maybe its my Database links..here is what i have for it..

3 tables.
CallRecords (Number dialed, duration, cost)

Call Types (type of call, IE.. long distance, local, interstate.

Departments (the only thing i use this for is to get the department name. which is a field called level2.


Departement is linked to Callrecords by a field called BillTo (Departments.Billto --> CallRecords.BillTo)Join Type= Left outer join, Link Type= (=)

CallRecords is linked to Calltypes by two diffent field names but same data which are called CallType and ID. (CallRecords.CallType --> CallTypes.id) Join Type = Left outer Join, Link Type = (=)


Thanks again for the help..


MCSE 2K - MCSA 2K - NET+ - A+

Paul..
 
To troubleshoot this, you might try laying out your department and callrecord fields in the detail section to see how they are repeating. This may suggest additional links that you should make. You appear to have {department.level2} and {callrecord.level2} fields, and yet you are linking on a billing field--you might want to try linking on both of these, both in the visual linking expert and when linking subreports. Not sure this is the issue though.

You could see what happens by changing the joins to equal joins, although this depends upon your logic for using left outer joins in the first place. However, by using selection criteria on the left outer joined table (callrecords), you are partly "undoing" the left outer join anyway, so not sure this is it either.

Anybody else who has ideas on this should jump into this thread...

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top