Related Information Examples & Tutorials

Envelope Tutorial

This tutorial demonstrates how to use the @RECT function of Collect!'s report writer to format address information for printing on letters to be sent in windowed envelopes. This information may be applied to any kind of windowed envelope. You can also use it for printing directly on envelopes.

This should help you expedite the mailing of large numbers of letters.


Address Information Displayed In A Windowed Envelope

The @RECT command is a powerful formatting tool for both text and graphics within the Collect! report writer. One of the most common and practical uses of this command is to print large blocks of text aligned to an exact page position. In this tutorial, we are going to create two address blocks in a debtor letter so that they are aligned correctly for a windowed envelope.

We will use the @RECT command to position the company mailing details in a small window on the upper left corner of the page and the debtor's mailing information in a slightly larger window to the lower right of the first.

RECT Command

The syntax of the @RECT command is as follows:

@RECT(left,top,width,height,border,clip)
Text and graphics go in here!
@RECT

Left, top, width, height are, respectively, the position and dimensions of the rectangle. These values are in 1/100ths of an inch.

Border controls whether or not Collect! draws a border around the rectangle. A value of 1 causes Collect! to draw a border. A value of 0 makes the rectangle "invisible."

Clip determines whether or not Collect! will print text outside the boundaries of the rectangle. A value of 1 causes text to be chopped off when it leaves the area of the rectangle. A value of 0 causes the remainder of the text to be printed anyway, even if it extends outside the rectangle.

As shown in the snippet above, the @RECT command has two parts. The first call to @RECT opens the rectangle, and the second call closes it. The resulting rectangle is like a miniature page inside the main page you are printing. Any text or graphics commands in between the two calls will be automatically aligned within the boundaries of the rectangle. Your report can use as many @RECT statements as you please, for an endless variety of formatting options.

Top of page.

Planning Your Report

Now that we have explored the practical uses and technical aspects of the @RECT command, we can prepare to use it in a report. Before beginning to design the report, we will do a mock-up of the letter you plan to print.

Mock-up Letter

Take a piece of paper of the same size and dimensions as the letter you will be designing. Draw a rectangular box, with a pen or pencil, exactly where you want the address information to be displayed. Draw a smaller rectangle for the return address window, if there is one. To be sure that the positions are right, fold up the mock letter and place it in one of the envelopes you will be using. Will the addresses be visible through the envelope windows, if they are printed in the rectangles you drew? If not, make whatever adjustments are necessary to the rectangles in your mock-up so that they fall perfectly within the window areas of your envelope.

Finally, draw a line where you folded your letter to fit it into the envelope.

tip.gif If you take the time to map out every part of your letter in this way, you will save valuable time when you design your report. With this mock-up accurately prepared and measured, you are spared the frustration of repeatedly changing and tweaking the dimensions in your report.

You may want to tweak your final report just a little, to get an absolutely perfect, professional looking letter.

Measuring Values for the @RECT Command

Now that your mock-up is completed, we are going to take the measurements of the rectangles so that we can use them in the @RECT command.

Here is an example of the measurements you will need:


Address Position Measurements

To obtain these measurements, for each rectangle:

1. Measure the distance from the upper left hand corner of the rectangle (marked with the red dot in the screen shot) to the LEFT side of the paper. This is the LEFT value. For example, LEFT =.25 inches. Jot down this value next to the rectangle that you are measuring.

2. Measure the distance from the upper left hand corner of the rectangle (marked with the red dot in the screen shot) to the TOP of the paper. This is the TOP value. For example, TOP = .20 inches. Jot down this value next to the rectangle that you are measuring.

3. Measure the distance across each block, the HEIGHT and WIDTH. Write these values on your mock-up, next to the rectangle you are measuring. For example, HEIGHT =1 .00 inches, WIDTH = 2.00 inches.

4. The @RECT command uses values in measured in 1/100ths of an inch.
So, we multiply each of the measurements by 100 to get the measurement units used by the report writer. So two inches becomes two hundred units. For example, LEFT = .25 inches x 100 = 25 units; TOP = .20 inches x 100 =20 units, and so on.

Jot these calculations down on your mock-up so that each measurement is converted into 1/100ths of an inch. Keep this handy while writing the report!

Measuring Position of the Fold Line

Measure the distance from the top of the page to the line that you drew to mark where you have to fold your letter. Multiply this by 100 to give you the units used by the report writer. For example, TOP TO FOLD = 3.75 inches x 100 = 375 units.

tip.gif If you are printing directly onto your envelopes, measure your two address blocks on a mock-up envelope, but you don't need to mark or measure a fold line.

Top of page.

Creating The Report

Now that you have your report planned and formatted, it is time to open the report writer and type in the codes necessary to turn this concept into a finished document.

1. Sign into Collect! and stop at the Main Menu.

2. From the top menu bar, select Print and then select Edit Reports from the drop-down choices. This will bring up the list of all the reports in Collect!

3. Select the NEW button at the bottom of the Report Definition list. This will open a blank Report Definition.

4. Select the field labeled Name and enter a name which is meaningful to you, for example, "Windowed Debtor Letter Template."

5. Select the field labeled Start on and then select Debtor from the list that appears.

6. Select the OPTIONS button in the lower left hand corner of the window. This will bring display the Report Options form.

7. Select the down arrow next to the field labeled Destination and then select Printer from the pick list that appears.

8. Select the field labeled Printer initialization codes and enter the following text.

@*PH

9. Select the field labeled Printer termination codes and enter the following text.

@HP*

These codes will reset the printer, set the page orientation to portrait, and the font to H (By default, Times New Roman, size 18).

10. Press F8 to save your settings and close the Report Options form.

So for a brief recap, we have now created an empty report called "Windowed Debtor Letter Template" (or whatever name you chose). It will be taking information from a supplied Debtor record, and it will print to your printer in Portrait format, in Times New Roman font, size 18.

Top of page.

Entering The Report Codes

Now for the nitty gritty. We are going to enter the individual codes that tell the report writer how to format the report and what information to print.

The report will proceed in two series of @RECT statements, four in total, which will form the two boxes. One box will contain the company information and the second box will contain the debtor information.

After the two boxes, we will draw a line to indicate where the letter should be folded to fit into your windowed envelope.

Here is a list of the database codes used in this report:

@cd.na - Form: Company Details, Field: Name
@cd.ad - Form: Company Details, Field: Address Line 1
@cd.a2 - Form: Company Details, Field: Address Line 2
@cd.a3 - Form: Company Details, Field: Address Line 3
@de.na - Form: Debtor, Field: Name
@de.ad - Form: Debtor, Field: Address
@de.a1 - Form: Debtor, Field: Address Line 2
@de.ci - Form: Debtor, Field: City
@de.st - Form: Debtor, Field: State
@de.zi - Form: Debtor, Field: Zip

Here is a list of the report commands used in this report:

@RECT

The rectangle command, as explained above.

@Line

The line command, which draws a line across the page from one point to another, indicating the fold line. This is optional, if you are printing directly onto your envelopes, ignore this command.

You should be looking at the Report Definition for the your "Windowed Debtor Letter Template" report. Select the Report Body and let's start entering those codes!

1. Begin with an @RECT command.


This will begin your first box. Use the measurements you took earlier and feed them into the command in the order listed above. (To recap, it was left, top, width, height). For the last two values, enter 0 and 1 respectively. This should yield the following line.

@RECT(left,top,width,height,0,1)

Where left, top, width, and height correspond to your measured values, in 1/100ths of an inch.

2. Next we are going to print the Company Name in bold, followed by the mailing address, followed by the city, state, and postal code.

@!@cd.na@!
@cd.ad
@cd.a2< @cd.a3



This assumes that your Company Details have been entered correctly, that the first line of your address is your street address, that the second line is your city and state, and that the third line is your zip code. The @! code turns the bold text option on and off, while the < symbol trims trailing spaces at the end of fields.

3. Now, close the rectangle with another @RECT command.


@RECT

This completes our first box, for company details.

Now begin another box using the measurements you took earlier, for the debtor information.

1. Type another @RECT command into your report body.


@RECT(left,top,width,height,0,1)

Where left, top, width, and height correspond to the values you measured for your second rectangle, in 1/100ths of an inch.

2. Next, enter the debtor information, as shown below.

@!@de.na@!
@de.ad< @de.a1
@de.ci<, @de.st<, @de.zi



This assumes that the Debtor form has been completely filled out, including all the above fields.

3. Now close that box with another @RECT command.


@RECT

This completes the second box.

All that remains is to draw the line showing where to fold the letter. The placement of this line depends on the size of envelope you are using. You can fold your mock-up and fit it into the envelope so that you know the ideal placement for the fold line. This should be equal to the height of the envelope. Ideally, the fold line should run the length of the page. Printers usually don't print all the way across the whole page, or starting directly at the top of the paper. So you should subtract around a quarter of an inch (25 units) from your measurements.

For example, when using 8.5"x11" paper with a 9.5"x4" envelope (standard letter size paper with a standard letter size envelope), the first endpoint of the line should be located at the coordinates 0, 375. This means, start right at the left edge and 3.75 inches from the top of the page. The second endpoint is at the coordinates 800, 375. That means, the line is 8 inches long, ending near the right edge of the paper, also 3.75 inches from the top of the page. (This allows for 8.5"x11" paper with 0.25 inches off each margin.)

So the line command would look like this:

@Line(0,375,800,375,1,1)

The last two values set the width to 1 pixel and the style to 1, which is the value for a dashed line.

Altogether your codes should be similar the snippet shown below.

@RECT(20,25,175,75,0,1)
@!@cd.na@!
@cd.ad
@cd.a2< @cd.a3
@RECT
@RECT(l300,225,300,200,0,1)
@!@de.na@!
@de.ad< @de.a1
@de.ci<, @de.st<, @de.zi
@RECT
@Line(0,375,800,375,1,1)

tip.gif Sample values are shown above for the @RECT (left, top, width and height) arguments. Notice how these relate to the measurements taken earlier. Remember that the last two arguments, 0 and 1, mean no "border" and "clip."


Address Position Measurements

Congratulations! You have completed the part of your report that will display the debtor and company information visible through the windowed envelopes. For the body of your letter, you may type your standard first notice or whatever information you would like to convey to your debtors. Now that this segment of the letter is completed you may copy and paste it into whatever other letters you wish, saving yourself further time in the long run, when dealing with a series of similar letters.

In addition, by replacing the information inside the boxes, with client information for example, you can preserve the same formatting for your client letters, as well.

Furthermore, you have just learned a powerful formatting technique that can be used to help you position text and graphics in any number of ways. This enables you to develop flexible and professional looking letters and reports that will impress clients and let your debtors know you mean business.

Top of page.

See Also

- Report Sample to view sample reports and letters
- Report Topics Index for a list of all report and letter topics

Top of page.

Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.

Please click this link to send us your comments: helpinfo@collect.org