Question

Printing a Report Footer only on the LAST page

Asked by: fmoore0001

Is there a way to get a footer to print only at the bottom of the LAST page of a report?

I am printing an invoice that I want to print on 8.5 x 11 two perf paper to have a tear off payment slip at the end of the report for the next payment due.  If I add the footer and only a few items print in the detail, the footer works fine.  But when the detail has to go to one or more pages the footer prints on every page.

I need the footer because the report prints it at the BOTTOM of the page.  A SUMMARY follows right after the last GROUP FOOTER or DETAIL band and is never in the right position.

I need some way to tell the FOOTER don't print until the last page and only if you have enough room ( 3.458 in), else go and print at the bottom of the NEXT page.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-10-19 at 23:11:27ID24825907
Tags

Microsoft Visual Foxpro 9.2

Topic

FoxPro Database

Participating Experts
3
Points
500
Comments
27

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. QReport bands...
    I have Quick report with: - Title band - ColumnHeader band - Detail band - Summary band - Footer band Title band is printed only on first page, Columnheader band on every page ONCE, Detail band is band on wich all data from table is printed to. Summary and Footer band are p...
  2. REPORT FOOTER
    WHERE CAN I ADD A REPORT FOOTER ? I ONLY FOUND REPORT SUMMARY BUT i THINK IT IS NOT A REPORT FOOTER BECUASE IT PRINT BEFORE A PAGE FOOTER
  3. Footers
    Suppose I have a document with a table of contents at the beginning of it, showing me where each point starts (in which page). I need to put in every's page footer the text of the content where that page is included. I mean. If Content "A" goes from page 14 to page...
  4. Problem with Page footer suppression!
    Hi, Requirement: I have a requirememnt where I want a certain piece of text that runs into 20 lines to appear in the footer of the first page of a report. My solution: I have put this text in the page footer and have the following details in the format section of the pa...
  5. Report Page Footer Problem
    Using VFP 6: I have a report that prints invoices. If the line item detail stops at page 1, but the group footer can't fit on page 1, then the page footer of page 2 prints using the following records data. Confused? good. For example: I have a page header that is a summa...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: CaptainCyrilPosted on 2009-10-19 at 23:41:39ID: 25611493

You can use a when condition to print the footer. You can even put it in the group footer. Only print when RECNO() >= RECCOUNT().

 

by: tusharkanvindePosted on 2009-10-19 at 23:44:46ID: 25611512

You can put EOF() in the print when of all controls in the page footer.

Or you can put the controls in the summary. Then count the records that will be printed. Add blank records so that the summary prints at the bottom of the page.

 

by: fmoore0001Posted on 2009-10-20 at 00:08:03ID: 25611612

Guys,

Using your info I tried a couple of things.

First, instead of the EOF or RECCOUNT() check, I used  _pagetotal == _pageno in the "On Entry" line.  it did not work.   Instead, I set up the PRINT WHEN section to have REMOVE LINE IF BLANK and PRINT ONLY IF  _pagetotal == _pageno.

That DID work, but the FOOTER is still "there". At least, the item DETAIL would not print in the FOOTER area, which is a waste of paper.

I AM getting the Footer at the end of the report, and thank you for that.  Any idea how ot use the space it wastes?

 

by: CaptainCyrilPosted on 2009-10-20 at 00:13:02ID: 25611627

Use the option remove if blank.

Or you could put another item there:

I used for example IIF(RECNO() < RECCOUNT(),something,anotherthing)

I also used back in FPW26 (this option is now available in VFP 9.0 FRX) a way to make have the form as invoice and the other half as receipt.

I used something like:
IIF(query.type = 'R', concatenate receipt fields, concatenate invoice fields)

 

by: CaptainCyrilPosted on 2009-10-20 at 00:14:09ID: 25611632

I am not sure when EOF() fires up. Maybe when RECNO is equal or only when more than RECCOUNT().

That's why I use this expression:
RECNO() >= RECCOUNT() && to be no safe side.

 

by: fmoore0001Posted on 2009-10-20 at 00:17:25ID: 25611643

I have the option REMOVE IF BLANK checked.  I am still getting the FOOTER area not being used.  There must be something to make it be used unless printed.

 

by: Olaf_DoschkePosted on 2009-10-20 at 00:23:36ID: 25611664

I'd try it differently: Make the footer you only want on the last page a group footer, and let the report group by a constant, so the whole report is one group and thus the group footer will only print on the last page.

Bye, Olaf.

 

by: tusharkanvindePosted on 2009-10-20 at 00:23:52ID: 25611665

If you use the page footer, you will get it on all the pages. It will be better to use the second method i mentioned of adding blank records and keeping everything in the summary band.

You can also add a memo field to the records and to the report.  keep it blank for all the records except the last record. In the last record, add as many chr(13)+chr(10) into the memo field and the number of lines you want to expand. In the report, let it stretch with overflow. That will also push the summary band down.

 

by: fmoore0001Posted on 2009-10-20 at 00:24:38ID: 25611669

I am wondering.  The PRINT WHEN is engaged in my  _pagetotal == _pageno statement prevents printing.  But, the fields are not actually "Blank", just no printting.  Would I have to go further and add:

IIF( _pagetotal == _pageno, Print_var, "") to force the blank line to remove?

 

by: Olaf_DoschkePosted on 2009-10-20 at 00:30:00ID: 25611689

menu: Report->Data Grouping
Add Button
when prompted for an expression, type in a constant, eg 0,1,'A', whatever.
put anything from the page footer to the group footer.

Another thing that should be usable for a report footer is the optional summary band.

Bye, Olaf.

 

by: Olaf_DoschkePosted on 2009-10-20 at 00:32:54ID: 25611699

Remove line if blank does what it says, it only removes lines that are totally blank. If you have a report label with a static text for example, this is making the line not blank. You'd have to have it's print when also set to only print at the last record.

I think a group spanning the whole report or a summary band fits your needs better and is easier to setup and maintain than a bunch of printwhens and removelineofblank must also be set at each report control or label of a line to really work.

Bye, Olaf.

 

by: fmoore0001Posted on 2009-10-20 at 00:33:29ID: 25611703

I am NOT getting the Footer printing on every page now with  _pagetotal == _pageno in the PRINT WHEN field.  I am using Visual Foxpro 9.2

I am still getting the area used for the FOOTER, though, even if blank.  My thought now is to make the fields go blank. (SPACE(0))

And, I need the FOOTER to print at an exact spot, which it will   The summary band will not.

 

by: Olaf_DoschkePosted on 2009-10-20 at 00:47:18ID: 25611759

fmoore,

With your problems of blank area and position of the summary band, I again suggest a group footer of a group spanning the whole report. Because: a) it will only print at the end and b) you can position it correctly. It will never appear or even just occupy empty space on any page before the last.

Bye, Olaf.

 

by: fmoore0001Posted on 2009-10-20 at 00:57:32ID: 25611798

Is there some way to set up a group footer to print in a particular position.  The regular footer does so, but the group footer appears to always follow the DETAIL band.

 

by: Olaf_DoschkePosted on 2009-10-20 at 01:14:07ID: 25611860

Okay I see, the page footer is taken from the bottom margin and the group footer just follows in the line after the group. I remembered, that you could setup the object position to be from the page top or bottom, but the object position can only be relative to the band's top or bottom.

The first thing that comes to mind is adjusting the footer position by adding empty records to the detail band (and NOT setting that to remove line if blank, of course) Then you'll need to find out what number of records will fill a whole page and thus what number of records you need to add blank to adjust the group footer.

Maby you could make the page footer not occupy space by unchecking it's "constant band height", if that is set. I imagene that would help make it shrink if the detail band needs more space and the footer is empty anyway.

Bye, Olaf.

 

by: Olaf_DoschkePosted on 2009-10-20 at 01:19:29ID: 25611884

By the way: What was wrong with the summary band you can add as optional band? It's adding a detail band you don't need, but you can set that to zero height. And it will be below the page footer, so it should print at the bottom margin of the last page.

Bye, Olaf.

 

by: tusharkanvindePosted on 2009-10-20 at 02:04:24ID: 25612081

Maybe you should take a look at ReportSculptor. http://www.report-sculptor.com/

 

by: fmoore0001Posted on 2009-10-20 at 12:55:41ID: 25617877

Olaf,  the summary band DOES NOT print below the footer, despite it's position in the report.  It always prints below the last GROUP FOOTER.  It is not a solution, alas, as I need the FOOTER position.  I have a billing statement with large number of details, and I need this FOOTER to print the tear off payment coupon.

Tusharkanvinde, ReportSculptor is very interesting.  Take a while to learn it, however.

 

by: Olaf_DoschkePosted on 2009-10-20 at 13:52:53ID: 25618471

Sorry fmoore,

now that I tried several things I see just the page footer really prints at the page's bottom margin and even if you set all elements in it to "remove line if empty" the occupied space isn't shrinked, no matter if the footer is set to constant band height or not.

Sorry, I'm no help here.

Bye, Olaf.

 

by: fmoore0001Posted on 2009-10-20 at 14:00:48ID: 25618558

I am going to try to make the Footer fields RESET to SPACE(0) to see if I can make them disappear (REMOVE BLANK FIELDS == .T.), but I am more concerned that PAGE FOOTER may design an area not excessable to DETAIL.

 

by: Olaf_DoschkePosted on 2009-10-20 at 22:32:26ID: 25620994

fmoore,

Yes, the page footer area is not accessible to the detail band. Remove line if blank does not shrink that area. I see no chance to get what you want.

Bye, Olaf.

 

by: fmoore0001Posted on 2009-10-20 at 23:06:10ID: 25621104

Olaf, as it stands, with a 3.458 in required pane, you are right.  for now I am writting off the area as 1) few clients will go to mulitiple pages and 2) it prints just fine on a single page.

FOOTER seems to be a fixed size.  I tested by making the fields in the area just set to SPACE(0) if _pagetotal <> _pageno.  Did not make a lick of difference.  FOOTER is involite.

I am studying more on Tusharkanvinde's suggestion on ReportSculptor.  It appears it can handle a situation this.  Pretty much any situation.

Frank

 

by: tusharkanvindePosted on 2009-10-20 at 23:20:30ID: 25621141

Besides ReportSculptor, I have advised to add lines to the last record. I feel that is a much easier solution

 

by: fmoore0001Posted on 2009-10-20 at 23:36:09ID: 25621192

I would have to spend some time checking the placement of the new 'footer' using that method.  I have found using lines it tends to fail with EXACT placement if you spread it over many printers, each with a slightly different definition of a lines's size..  Remeber, I have thousands of folks and printers using this program.  

Tusharkanvinde, it is a very good suggestion and one i have used before, but I don't think I can rely on it in this case.

 

by: tusharkanvindePosted on 2009-10-20 at 23:59:05ID: 25621275

If you have to give it to different client and different printers, maybe you can have a setup form, where the user can enter a value like , move the footer 0.2 inches down. Then you can update the vpos column of the frx file before printing.

 

by: fmoore0001Posted on 2009-10-21 at 00:13:08ID: 25621313

That may work as an alternative.

 

by: fmoore0001Posted on 2009-10-21 at 00:17:58ID: 31643803

Thanks for all the discussion

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...