HOWTO: Including Report Toolbars in a Distributed Application

ID: Q138969


The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 6.0


SUMMARY

In a distributed application, you may need to allow users to modify report layouts to fit their specific needs. While you can add this functionality, unless specific steps are taken, it is possible that there will be no report toolbars available. This article explains how to make the report toolbars available from within a distributed application.


MORE INFORMATION

There are two methods available to ensure that toolbars are available in your application. The first requires the Foxuser resource file, and the second uses menus and system menus.

Method One

Toolbar state information is stored in the Foxuser resource file. Whenever a report is modified or created in the design environment and the report toolbars are open when that report is saved, the state of the toolbars is written to the Foxuser file.

NOTE: The Toolbars submenu is not available until a report in actually open. If you go to the View menu and try to select Toolbars, it is dimmed out if nothing is open in modify mode.

When you use this method to ensure that report toolbars are available from within the application, you must meet these conditions:

  • You must have modified or created a report in the design environment with one or both report toolbars open. You must then save the report. This will save the state of the report toolbars.


  • The Foxuser resource file must be distributed with your application.


  • The resource file must be either built into your application or marked as read-only. If it isn't, when the report is modified, the toolbars closed, and the report saved, the state of the toolbars will also be saved. As a result, because the toolbars are now closed, there is no direct way to re-open them from within your application. By marking the resource file read-only, if the user should close the toolbars, the resource file will not be updated with the new state of "closed."


Method Two

A second and perhaps easier way to achieve the same result involves using the Visual FoxPro System Menus. The following example shows how to do it:

  1. In the Command window, type:
    
       CREATE MENU TESTMENU 


  2. For the prompt, type the word "View." The result should be set to Submenu.


  3. Click the Options button. The pad name should be _msm_view.


  4. Because the View option takes you to a submenu, you need to click the Create button located to the right of the Submenu popup. For the prompt, the standard text is "Toolbars."


  5. Set the result to a value of Bar #. The prompt to the right of the words Bar # will be _mvi_toolb.


  6. On the View menu, click Menu Options, and name the menu _mview.


When you compile the menu, you should have Toolbar functionality in your application.

Additional query words:

Keywords : kbVFp kbVFp300 kbVFp600 FxenvFoxuser
Version : 3.0
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: August 12, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.