Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Printing subtotals in sub-summary problem


This topic is 7931 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Having trouble printing a sub-summary total in a report. I've got the sub-summary setup on a records per page, and can get the sub-summary total to print in the sub-summary(trailing) its a running subtotal. My problem is that in order to get it to show in preview or print, I have to touch the top edge of the field to the bottom of the body, when I do that, it also shows the subsummary in each record in the body! I only want to see it in the sub-summary section.

Help! confused.gif

Posted

Figure out how many records fit on a page. Put that number in a global variable. Experiment with this number. Create an unstored calculation field as below, the PTR_gLinesonpage is the global. Create a subsummary part on your lay-out and make it appear when sorted by this field.

Also script the sort-event, and refer to the sort-script-step in the script that executes your printing.

Hope this helps.

Harryk (and below is the calculation)

Int((Status(CurrentRecordNumber) -1) /PTR_gLinesonpage)

One more remark, in the subsummary definition, let a page-break occur after each occurence.

-

-

---mmm, funny thing, I made this post up in IE5 mac, but all carriage returns (lines) seem to have disappeared! Stephen, do you have a clue for this???---

Posted

Make sure the Subsummary when sorted by... agrees with the sort order in use.

-bd

Thanks.

This works, but my subsummary is showing up on the second page and there's plenty of room left on the first page for it. Strange.

Posted

Figure out how many records fit on a page. Put that number in a global variable. Experiment with this number. Create an unstored calculation field as below, the PTR_gLinesonpage is the global. Create a subsummary part on your lay-out and make it appear when sorted by this field.

Also script the sort-event, and refer to the sort-script-step in the script that executes your printing.

Hope this helps.

Harryk (and below is the calculation)

Int((Status(CurrentRecordNumber) -1) /PTR_gLinesonpage)

One more remark, in the subsummary definition, let a page-break occur after each occurence.

-

-

---mmm, funny thing, I made this post up in IE5 mac, but all carriage returns (lines) seem to have disappeared! Stephen, do you have a clue for this???---

Tried this one too, won't let me sort on the global field. frown.gif

Posted

If I understand the question, you simply want a total of the page's records at the bottom of each page. If so:

1. Create a global number field called gRecordsPerPage.

2. Create an unstored calculation field called cPageNo with this formula:

Int((Status(CurrentRecordNumber)-1)/gRecordsPerPage)

3. Put a trailing subsummary part (sorted by cPageNo) at the bottom of your page layout. Set it to page break after every 1 occurence. Put your page total summary fields in this part.

4. Figure how many records will fit on a page and set gRecordsPerPage to this value.

5. Sort by cPageNo.

6. Print.

I realize that this is pretty much what Harry has already said, but I have used these exact steps in my own databases and they work.

Note that you don't sort by a global field. There is no point because the global by its very nature always contains the same value no matter what record you are on. You should actually be sorting on a calculated field (cPageNo).

Posted

>No sort on the global field

Yep, but you should not sort on the global field but on an unstored calculation field that contains:

Int((Status(CurrentRecordNumber) -1) /PTR_gLinesonpage)

Name that field the way you like, and use that field to make appear the subsummary.

This works, I use it myself.

There is only one drawback. As the records are sorted by this field, another sort is impossible. But I know of no other way of getting a running total subsummary at the end of a page.

Harryk

Posted

I must be doing something wrong. I do get the subsummary page totals for each page as you both instructed. This works great, no problem getting the sub-totals. The problem I have now is that the subsummary total for the first page prints after the header part of the second page and then the records for the second page begin,followed by the second page subsummary(the records end on the second page). I'm printing landscape and have adujusted the body size(all over the place) to be sure there is enough room for the subsummary totals How can I get the subsummary for the first page to stay on the first page where it belongs etc.:: confused.gif

Posted

I do not know the cause of that problem. It is a TRAILING summary? (summarys can be leading or trailing). Furthermore, do you for the first page use a title header which is larger then the normal header? This would explain why on the second page and further the things are allright.

Or are the lines that the records occupy larger then normal on the first page?

I'm printing landscape and have adujusted the body size(all over the place) to be sure there is enough room for the subsummary

You use list view in this case, and I do not understand you saying that you adjusted the body size. You keep the body as tight as possible, the more records fit on a page. The subsummary is below the body part..not part of the body itself.

Harryk

Posted

Make sure that in the part setup, you have the summary part set page break AFTER 1 occurence, not before. And make sure that the body part is not set to page break at all.

Posted

Thanks to all of you! I found it yesterday, i had checked the box in the body part to break early on and forgot to uncheck it. duh. Thanks again to all of you, its working perfectly!

This topic is 7931 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.