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 SkipVought 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 put a running total in a Reports 6i 2

Status
Not open for further replies.

ChrisHunt

Programmer
Jul 12, 2002
4,056
0
0
GB
I need to write a report which shows a running total at the foot of each page. The report is a series of (potentially) multi-page sections each formatted like this:
[tt]
Page 1
======

Tom £100
Dick £150
Harry £100

Sub Total £350

Page 2
======

Peter £200
Paul £50
Mary £100

Total £700
[/tt]
Lines are of variable height, so I can't predict how many there'll be on a page.

The help system just tells me to "use a summary field". Yeah, right. Can anybody give me some more detailed instructions?

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Create a summary field that sits outside of any groups in the data model. Then make sure the function of the summary is sum, and select the source as the column you want to sum on.

Finally, on the layout model you will need to position a field with a source of the summary column somewhere outside all of your repeating frames. You will also need to set the 'Reset At' property to page.
 
Will that not just give me the sub-total for that page only? I need it to work like this:
[tt]
Page 1
======

Tom £100
Dick £150
Harry £100

Sub Total £350

Page 2
======

Peter £200
Paul £50
Mary £100

Sub Total £700

Page 3
======

Fred £100
Barney £100

Total £900
[/tt]

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Ok, then. Try reset at report and print on each page perhaps. You may have to experiment a bit to get theright settings for you. Also play about with the location of the field on the layout - for example which frame the field falls in.
 
BTW you may ask Reports questions here where our Reports expert Nagornyi would help you with pleasure :)
AFAIK he doesn't hate Reports and answers such questions immediately.

Regards, Dima
 
Ah, I wondered if there was an Oracle Reports forum here, but couldn't find one. I was expecting to find it with the other Oracle fora.

Anyway, I think I'm on to a solution. I'm gonna add a hidden summary column that will hold the running total on every line -
[tt]
Page 1
======

Tom £100 £100
Dick £150 £250
Harry £100 £350

... etc ...
[/tt]
I'll then put a field in the margin that will have the MAX() of the summary column, reset by page. Since the individual amounts are (fortunately) always positive, I think this will work.

PS. I don't think it's possible to work with Oracle Reports without hating it. It's a truly terrible piece of work.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top