Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

The Visual FoxPro 9 Report Writer : Page 2

Microsoft has significantly improved the Report Writer in Visual FoxPro 9, while maintaining compatibility with previous versions of Visual FoxPro Reports, making the new Report Writer a great blend of the old and the new.


advertisement
Protection
 
Figure 3. Object Protection: Use the Protection tab of the Properties dialog box to set protection modes of a layout object.
In Visual FoxPro 9, you can create protection for one or more layout objects when using Report Designer or Label Designer. This lets your user modify a report, yet keeps them from making certain changes.

Layout objects have five protection modes you can set, and Field objects have an additional protection option. Bands have two protection modes you can set. The report itself has a variety of different protection modes you can set.

Protecting an Object
To protect a layout object in the Report Designer, select the Properties dialog box for the object. The Properties dialog box can be invoked from the Report menu after selecting the object from the right-click menu of the object, or by double-clicking the object. Figure 3 shows the Protection tab of the Properties dialog box for a field object. You can set the following five protection modes for layout objects:

  • Object cannot be moved or resized. Prevents users from moving this layout object to a different position on the design surface and prevents users from resizing this object.
  • Object cannot be edited. Prevents the user from making changes to the properties of this layout object.
  • Object cannot be deleted. Prevents the user from deleting this object.
  • Object cannot be selected. Prevents users from selecting this object. When this option is selected, the protection behaviors of Object cannot be moved or sized. Object cannot be edited and Object cannot be deleted are also imposed.
  • Object is not visible in Designer. Prevents this object from appearing in the Report Designer in protected mode. When this option is selected, the protection behavior of the other four options is also imposed.
The "Design-time caption" portion of this dialog box only applies to Field objects. The literal string entered into this textbox is displayed in the Report Designer, instead of the Expression. This gives you the opportunity to display something that is user-friendly instead of a complicated expression.

 
Figure 4. Band Protection: Use the Protection tab of the Band Properties dialog box to set protection modes of the band.
Protecting a Band
To protect a band in the Report Designer, select the Properties dialog box for the band. The Properties dialog box can be invoked from the Edit Bands... option on the Report menu, from the right-click menu of the band, or by double-clicking the gray bar of the band. Figure 4 shows the Protection tab of the Properties dialog box for a band. You can set the following two protection modes for bands:

  • Band cannot be edited. Prevents the Band Properties dialog box from being accessible to the user.
  • Band cannot be resized. Prevents the user from resizing the band.
Protecting a Report
To set overall report protection, select the Report Properties dialog box. You can invoke this dialog box by selecting "Properties" from the Report menu or from the right-click menu of the report. Figure 5 shows the Protection tab of the Report Properties dialog box.

The top portion of this dialog box allows you to define which tabs of the Report Properties dialog box are unavailable to the user. For each of the selections made in this area, the applicable tab of the Report Properties dialog box is disabled. The Protection option is always checked and disabled. The Ruler/Grid option is disabled because the tab cannot be protected, although it appears on the dialog box so that the selections are consistent with the tabs on the Report dialog box.

 
Figure 5. Report Protection: Use the Protection tab of the Report Properties dialog box to set overall protection modes of a report.
The bottom portion of this dialog box allows you to define which menu options are unavailable to the user. For each of the selections in this area, the applicable menu option is disabled.

Honoring Protection Flags
To invoke protection during a Report Designer or Label Designer session, use the PROTECTED keyword, as shown in the following examples.

CREATE REPORT MyReport PROTECTED MODIFY REPORT MyReport PROTECTED CREATE LABEL MyLabel PROTECTED MODIFY LABEL MyLabel PROTECTED

If the PROTECTED keyword is not used, the Report Designer functions as if no protection were applied to the layout objects.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date