New in Microsoft Visual FoxPro (VFP) 9 Report Designer is the concept of protection. Protection makes it easier to distribute reports without worrying about exposing too much to users. Figure 1 shows the basic Protection tab for a field object on a report.
 |
| Figure 1: Protect me! -- Protection lets you ensure that a user can't modify certain aspects of a report. |
With Protection, you can restrict individual objects so users can move and resize them, but can't remove them from the report (this is useful for copyright notices or application names). You can even prevent objects from showing in the Report Designer when the user modifies the report, but make them appear in the final output of the report, such as Draft or Final version captions.
Add the new PROTECTED keyword to the MODIFY REPORT command to display the report in protected mode:
MODIFY REPORT PROTECTED
Without the PROTECTED keyword, the designer appears as it always has. If a table uses cryptic field names, set the design-time caption to a friendlier representation. When viewing a protected report, the user sees the friendly name for the object instead of the table expression. This is a great way to let users modify reports without affecting critical information. You can set common protection properties on multiple objects, making it easy to set up complex reports.
Adding objects is also easier. As soon as a control is placed on a report, VFP displays the associated dialog, prompting for caption, expression, and other properties.
This tip comes from "A Tale of Two Report Designers" in FOXPRO ADVISOR magazine and shows just one example of the improvements made to the Report Designer in version 9 of VFP. In the full article, Andrew MacNeil shows you everything you need to know about the new Report Designer's output changes, "under the hood" improvements, ways for managing report options, and more. Pro-level subscribers can read the article online at http://Advisor.com/doc/14142.