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

VFP8. Invoice totals on last page 1

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
623
GB
I have a report which is a sales invoice and I want to print the invoice totals (and related captions) on the last page.

At present I put the fields into the page footer and have a "Print When" clause for each field, saying effectively "Print when _pageno = _pagetotal".

I would like to make it easier for the user who may modify the report, and have tried setting a report variable,
"LastPage" which is set to this logical value, so that the user would only have to test this.

This does not always work, even though I set it in the "On entry" to the page footer as well as in the "Value" where I define the report variable.

Is there an easier way of printing report totals in the footer of the last page only?

Thanks. Andrew Mozley
 
Hi Andrew,

You can use a Report Summary band which will only print at the end of the report.

Jim
 
Thanks Jim. I have added a summary band. Can I get that to print at the bottom of the last page (i.e. at the foot of page 1 on a 1-page invoice, at the foot of page 2 on a 2-page invoice)? At present I am getting an extra page with just the summary on it - I would prefer not to have the extra page.

Andrew M.
 
Summary band is printer immidiately after last record printed. If you set that Summary must be printer on new page this band will always printed on new page.
If you want totals to be printed in Page Footer on the LastPage printed you can do this:

Put all totals in PageFooter and set Print When to be like this:

_pageno == _pagetotal

That way all these totals will be printer only on last page

Borislav Borissov
 
Andrew, unless you have checked "New Page", or the Summary Band is too big to fit, it should automatically print where you want it to.

Jim
 
Thanks borissov.

That is actually what I do at present (see the beginning of my first post) I just wondered if there was a better way of printing totals at the foot of the last page.


Thanks Jim.

I have set up a summary band. It certainly prints after all the line details, but this is liable to be wherever the last line detail was. I would however like it to appear at the foot of the page. Is there any way of doing this apart from putting the total fields into the page footer and the using a "Print When" clause (as in my original post).

regards. Andrew M.
 
Ways I can think of to force the summary band to the bottom of the page are workarounds. I'd go with the the "Print When" solution.

Jim
 
How do I print totals in the Page Footer band of only the last page?

is a subtitle in "visual foxpro report writer" by Cathy Pountney from Hentzenwerke Publ.

set a report variable llast page with value of .f.
leave calculation option at Nothing
Create summary band and put _vfp.setvar('llastpage',.t.) in it
set the print when expression of all the objects in page footer to llastpage.

there are a couple other ways mentioned as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top