Changing the Template Files

MasterPlan supplements many of the columnar (table) reports with textual analysis and description reports. To create these reports, MasterPlan reads a template file and dynamically merges the template with the client's information.

After the report has been created, you can use Microsoft Word or any word processor or text editor to change these reports, as you might change any other document created directly within Word. However, if you find that you are making the same changes each time, you might want to modify the actual template itself.

Overview: How to Modify a Template

  1. Make a backup copy of the template you wish to change (so that you can always retrieve the original template).

  2. Read the template file into a text editor. Make the desired changes. For example, you can just change a word or two or add some sentences. Or you can reorder paragraphs or change the conditions under which paragraphs are included. To preview the special variables (or codes) that MasterPlan uses in these reports, jump to the section List of Variables Used in the Template Reports.

  3. Save the template file as a text (ASCII) file. This last step is very important. If you save the template some other type of file (like a Microsoft Word file), MasterPlan will not be able to process all the control characters unique to Word.

If you want to change the structure of the report drastically, and if you are not an experienced computer user, then we suggest that you get someone to help you. The person does not have to be a professional programmer, but they should know how to decipher an IF-THEN-ELSE statement.

Remember, back up the template files first. You can change anything about these reports except the heading.

What is a Text (Standard ASCII) File?

The REP and RPW files are standard DOS (ASCII) text files. After you modify them, you must take care to write them back to disk again as standard DOS (ASCII) text files.

Why? Many word processors create files that are not ASCII files; rather, these files contain special paragraph, enhancement, and word-wrap characters. You need to use the "Save As" command in your word processor and select the "ASCII" or "Text Only" format from the options listed.

NOTE: If you fail to create an ASCII file, you will get unpredictable results when MasterPlan tries to print the report.

Files Can You Modify

If you open up Windows Explorer and browse to the \MPWin\Report folder, you will see a group of files with an extension of .REP and another group with an extension of .RPW. For each template, there is one .REP and one .RPW file.

The .REP Files

When you send a report to MasterPlan's RTF editor, MasterPlan reads the files with an extension of .rep.

The .RPW Files

MasterPlan reads these files when creating a report to send to Microsoft Word. These files include the commands to the macro which send the tab positions, turn on the shading, etc.

Format Of The Report Files

Internal Contents

The report is simply an arrangement of paragraphs with MasterPlan variables inserted at appropriate places. MasterPlan replaces the variables with actual amounts and/or names from the client data when it prints the report. You must precede each variable with a tilde ( ~ ), or MasterPlan will not recognize that it is a variable and will print the variable name as part of the paragraph.

If you just want to add, change, or delete some of the words inside a sentence, then you don't need to concern yourself with the IF statements. However, if you want to change the basic structure of the report, then you need to pay close attention to them.

Sometimes entire paragraphs, or parts of paragraphs are nested within IF statements. These IF statements tell MasterPlan to conditionally print certain parts of the paragraph depending on the value contained in the variable.

For example, the IF statement might tell MasterPlan that if a certain variable contains a value that is greater than 0, it should print the following sentence or two; however, if the variable contains a value that does not meet this condition, then MasterPlan will skip that text.

How To Modify A Report File

Be sure that you have made more than one backup of the original contents of the file. Use MasterPlan to print one or two versions of the report so that you can see what the final product looks like before you make any changes.

Then read the REP or RPW file into your word processor. Modify it according to taste, and write it out to disk as an ASCII text file with the same name.

Now run MasterPlan again to produce the new versions of the report with the same data that you used above. Check the new reports very carefully with lots of different sample data to make sure that your modifications work in all instances.

If you made some mistakes, then read the report file back into your word processor and make the necessary changes. Test the modifications again very carefully.

Finally, make several backup copies of the new REP and/or RPW template files.

Note: Before you install a MasterPlan update that changes the template files, be sure you have made backups of your edited versions. The MasterPlan installation program will always tell you if we are going to replace any of these files.