In this sample, we will create a report that generates a form letter to each customer, with terms and conditions on the back side (represented as Cogniza’s logo). Moreover, the page numbering will only count the front of each page.
To get started, create a report using the Xtreme sample database. Add the ‘Customer’ table to the report. Next, insert a group on the ‘Customer Name’ field. Finally, suppress the Report Header, Page Footer and Report Footer sections.
Right-click the group’s footer and select ‘Insert Section Below’. This will create a section section immediately below the current section. You should see two sections: Group Footer #1a (GF1a) and Group Footer #1a (GF1b).
Add a text object to this section, then add all relevant mailing-address fields to this text object.
Create a formula field named ‘PageNumberIncr’. Add the following text to its formula text:
Numbervar nPage := nPage+1;
Add this field the group header section, then suppress it. This formula will increment a page counter every time the group header section is create, which is once per customer.
Add text object with the letter’s message.
This setting will make this section act like the letter’s page footer. Right-click the section and select Section Expert… Check ‘Print at Bottom of Page’, then click ‘OK’ to close the dialog window.
Create a formula field named ‘Page N of M’. Add the following text to its formula text:
//Use this field if you only want to count the front of each page
"Page " & ToText(nPage,0) & " of " & ToText(TotalPageCount/2,0)
Add this filed to the GF1a section, size it to be the width of the section, then click the ‘Align Center’ toolbar button.
This section will act as the back page of the form letter. Resize the section to be nearly a full page in length–for starters, try 9.5″. Next, insert an image or text object that contains your terms and conditions into this section. Finally, right-click the section’s name and select Section Expert… Check ‘New Page Before’ and ‘New Page After’, then click ‘OK’ to close the dialog windows.
If you don’t have access to a duplex printer, print the odd-numbered pages (the fronts) first, return these pages to the printer (making sure to orient the pages correctly), then print the even-number pages (the backs).