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!

How do I include subreport totals in report totals?

Status
Not open for further replies.

RCPD700

MIS
Jun 20, 2001
75
US
I don't work with Access enough to know how to pull this off, so I'm hoping somebody can help me out...

I have a number of tables I'm using to produce various reports about COBOL programs that will be migrated off our mainframe:

Source programs - name, description, owner, lines of code
Copy members - source prog name, member name, lines of code
Called routines - calling pgm name, routine name, type, lines of code

What I want to do is produce a report that shows source program information with a subreport showing all copy members used with lines of code for each, and another subreport with all called routines.

For each program, I want to include the number of lines of code from the subreport in the total lines of code for the program:

Pgm -------Descript.------- Lines
MAINSOURCE Description_of_program 2750
Copy Members: _
Member_One 75 \
Member_Two 50 \
Member_Three 15 > From
Called Routines: / Subrpts
DateConv /
DBNTRY --
MAINSOURCE total lines of code 2890

How does one add the totals in a subreport into the main report total? -- in this case lines of code.

If this isn't clear enough, let me know and I'll try to clarify.

Thanks in Advance,


Jim
 
Why do you need to use subreports? Have you been told to or is there another important reason?

I would simply have a query to pull all your data together as one dataset and use the report's features to do your totals as required.

 
My thinking was that if I created sub-reports for the additional details, I could easily produce reports from general (about main programs only) or increasingly more detailed.

I not certain a single dataset would work well since the information is not the same for each type. A single copy member or called routine can be used by many of the main programs. Like I said before, I don't do this enough to be very sophisticated... I'm primarily a mainframe guy - but I'm learning.

The main program inventory table is fairly detailed having program name, description, library member type, source library name, owner and lines of code.

The copy member table simply has main program name, copy member name, copy parameters (overrides) and lines of code.

The called routine table has only calling program name (main program) and called routine name.

It just seemed more practical to use subreports given the data I have.

Jim
 
I would add a report total in the subreport. You can then add a text box to the main report with a control source like:

=subrpt.Report.txtTotal

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I'd go with dhookum's suggestion if you are confident that you need/want subreports :)

If you don't mind, for interests sake, please confirm the following:

[main program inventory] table
A. program name,
B. description,
C. library member type,
E. source library name,
F. owner
G. lines of code

[copy member] table
H. main program name,
I. copy member name,
J. copy parameters (overrides)
K. lines of code

[called routine] table
L. calling program name (main program)
M. called routine name.

? For every [main program], there are 0 or more [copy member] linked by A=H

? For every [main program], there are 0 or more [called routine] linked by A=M

I might have these relationships backwards because from your last post, "A single copy member or called routine can be used by many of the main programs" which may not have been written with this data in mind - sounds more like a programming factoid in your problem space. If you do have a many to many relationship then you either have a lot of mostly duplicate records or a join table.

My purpose for asking is to explore whether a single query can do anything for you. I always like to try things in various ways and these forums have shown me things that reports can do that I never believed possible previously :)
 
In response to PCLewis, yes your understanding of the tables is correct. Your assumptions about the 1 to many relationship of main program to copy members and main program to called routines is also correct.
To provide an example involving one program:

PROGRAM_INVENTORY:
Name -----Description----- Type -Source Library- Ownr LINES

J14148 Enter Booking Charges CICS PROD.CJIS.SOURCE SO 2174


COPY MEMBERS:
SOURCE_PROGRAM COPY_MEMBER PARMS LINES

J14148 CJSCATRL 10
J14148 CJSCTIME 6
J14148 J14148C 80
J14148 J14148H SUPPRESS 80
J14148 CJSCATTR 40
J14148 CJSCDBAS 25
J14148 CJSCKY31 24
J14148 CJSCCOMM 120
J14148 CJSCDT31 6
J14148 CJSCHD31 10


CALLED ROUTINES:
CALLING_PROGRAM CALLED_ROUTINE

J14148 EDITNA31
J14148 RJUST31
J14148 EDITNU31
J14148 DBNTRY
J14148 TBLSOR31


A little sloppy, but you get the idea.



Jim
 
I think the only way you can present this information with two 1-many relationships to the same "1" table is with one or more subreports.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top