|
Pagebreaks, Report Groups and SortingYou will need to use the special PAGEBREAK field for documents where many items will be printing for each customer. Let's examine the DiscountContract.doc that came with Office Express to illustrate this point: This document will print the services scheduled for each customer you select. The Report Designer is using a tabular report style, if you are not familiar with this, reread sections one and two on the Report Designer. In tabular style, at print time, the report engine is going to print as many items as it can on a page. In the above example, we want to have all the jobs for each customer to print on a page, but only one customer per page. Notice the PAGEBREAK command in the above image. Without the PAGEBREAK command, the report engine will start printing the next customers jobs on the same page because it is looking to fill the page. The PAGEBREAK tells the report engine to stop printing jobs on this page when the last job for the current customer has printed. There is one more item of note that you will need to understand, the use of a report Group in the above image. Notice the two dark gray areas labeled: Group Header: Customers->ID and Group Footer: Customers->ID. This tells the report engine to "group" scheduled jobs together by the customer id. In the group footer are summary fields that calculate the totals for the customer that just printed. Summary fields were discussed in a previous section so we won't cover them here but what is important is where they are placed in the designer. The Group Header is the area BEFORE scheduled jobs start printing, the Group Footer is the area AFTER the last scheduled job has printing for the customer. Obviously, you would want to summary and totalizers to print after the customer's jobs have printed. When the Group Footer has been reached, all the jobs for the customer have printed. This is the place that you put your PAGEBREAK command. Notice in the image above, the PAGEBREAK is after the summary fields. When the report engine reaches the PAGEBREAK command, it knows not to print anymore jobs on the page and then drops down to print the page footer to complete the page. To use the PAGEBREAK command:
USING REPORT GROUPSReport Groups allow you to group data together on data fields you choose. For example when printing a completed job report you could create a report group for the Date field. This would group and sort all the completed jobs by the date they were completed. Report Groups also give you header and footer areas where you can place column headings and group totals. Continuing with the Completed Job report example, if you define a group for the Date field, you can then use summary fields in the group footer to print totals for price and tax, thus giving you totals from day-to-day. You can also put report groups inside report groups. Again, using the Completed Job Report example, you could place a Report Group for the Crew field inside the Date group. This now enables you to calculate totals for each crew for each date if you have more than one crew. Notice how this is done in the image below... This image was taken from the Short Route Sheet that came with Office Express. Let's analyze the use of report groups in this document. NOTE: This document is probably as sophisticated as you'll get when creating reports. When you understand this document you're ready to create some very powerful reports. 1. The report is in Tabular style, the presence of the Details Header, Body
and Footer make it tabular. There's a lot there, but it is straight forward and logical. For most cases you won't need to create documents as complex as the one above, but if you learn to understand it, you have the power to use the Report Designer to it's fullest. SIMPLE SORTING AND FILTERINGOffice Express allows you place a simple sort without having to use Report Groups. You can access the sort by: 1. clicking the File option from the main menu In this example, a sort on the Customer Invoice table has been added and a Filter on the Customers table was defined. This would be ideal for a report where you wanted a listing of all customer invoices for only customers who have an outstanding balance. The invoices would print sorted by date as defined above. This dialog box with it's sorts and filters allows you to do many powerful things in and of itself. Take the time to learn Row Filters because Office Express uses this features in many areas of the program. Click here to learn about Row Filters... Home | Getting Started | Table of Contents | Report Design Part 1 | Report Designer Part 3 | Report Designer Part 4 | Report Designer Part 5 | |