Crystal Report: Include Terms and Conditions on a Form Letter

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.

Instructions

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).

GH1

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:


WhilePrintingRecords;
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.

Details

Add text object with the letter’s message.

GF1a

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
WhilePrintingRecords;
Numbervar nPage;
"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.

GF1b

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.

Summary

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).

Sample

Crystal Reports 10 – Include Terms and Conditions on a Form Letter

One thought on “Crystal Report: Include Terms and Conditions on a Form Letter

  1. John Treweeks

    great article. What about if the letter goes dynamically over more than one page. ie if its a statement or an invoice where there are multiple details, and enough to take the details section to 2 pages? I downloaded your example and modified it to work off an invoice lines table. it worked a treat for less than x lines. once the number of lines took it to more than 1 page, then page 2 was the overflow, and page three the Ts&Cs.. is there a way to skip the second page and do the overflow on the 3rd, with another page of Ts&Cs on the 4th?

Leave a Reply

Your email address will not be published. Required fields are marked *