ACC: How to Print Group Footer at Specific LocationLast reviewed: January 29, 1998Article ID: Q119655 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. This article describes how to print a report's group footer information at a specific place on the page. This can be useful when you are printing reports to preprinted forms. While you cannot do this using the group footer's property settings, you can use any of the following three methods described in this article:
MORE INFORMATION
Method 1: Using the Page FooterThe page footer is always printed at a fixed location on the report's page, just above the bottom margin. For example, if your form has a bottom margin of 1 inch and the height of the page footer is 1 inch, the page footer begins 2 inches from the bottom of the page, or 9 inches from the top of the page (for an 11 inch long page). Placing the group footer controls in the page footer causes them to be printed at the page footer's fixed location on the page. NOTE: You cannot use aggregate functions in a control in a page footer. If you need to use aggregate controls in your footer, you may want to use the next method in this article, or refer to the "Using Macros to Print Reports or Transfer Data" chapter of the Microsoft Access "User's Guide" for an example of calculating totals in a page footer.
Method 2: Setting Report Properties for the Footer SectionThis method involves using the MoveLayout, PrintSection, and NextRecord report properties to move the group footer to a specific printing location on the page. With this method, you are not actually specifying the group footer's coordinates on the page, but moving the group footer to various existing printing locations on the report page. To ensure that the group footer is printed where you want it to be, you must consider the height of each section of the report. Since you cannot specify the location of the group footer section (or any other section) with a property setting, you must use the MoveLayout property to move the section to the next available printing location. For example, if the group footer section's height is 0.5 inches and the Top property (which specifies how far from the top of the report the section is printed) is set to 3.75 inches, then the MoveLayout property moves the group footer section to be printed in the area from 3.75 inches to 4.25 inches from the top of the report (a total of 0.5 inches). The following example demonstrates how to print the group footer at a specific place on the page by adjusting the section heights, and by using a sample user-defined function called SetGrpFtrLoc() that tests to see if the Top property is set to less than the GrpFtrLoc setting (the location where the group footer will be printed). If it is, the function moves the group footer section to the next printing location. If not, it does not move the group footer. CAUTION: Following the steps in this example will modify the sample database NWIND.MDB. You may want to back up the NWIND.MDB file, or perform these steps on a copy of the NWIND database.
Method 3: Setting Report Properties for the Detail SectionA similar approach is to use the MoveLayout, PrintSection, and NextRecord properties to print a blank detail section until the location for printing the group footer section is reached. This method is preferable to moving the group footer section if the detail section is smaller than the group footer section. The following example demonstrates how to print the group footer at a specific place on the page by using a sample, user-defined function called SetDetailLoc() that tests to see if this is the last detail section. For the last detail section, it then tests to see if the Top property is set to less than the GrpFtrLoc setting (the location where the group footer will be printed). If it is, the function moves the detail section to the next print location. If not, it does not move the detail section.
REFERENCES
Microsoft Access "User's Guide," version 2.0, Chapter 26, "Using Macros to Print Reports or Transfer Data," pages 693-696 For more information about the MoveLayout, NextRecord, and PrintSection report properties, search for "MoveLayout" then "MoveLayout, NextRecord, and PrintSection Properties" using the Microsoft Access version 2.0 Help menu. Keywords : RptSort kbusage Version : 1.0 1.1 2.0 Platform : WINDOWS Hardware : x86 Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |