Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make the Report ControlsToolbar automatically visible? 3

Status
Not open for further replies.

ezpzjohn

Programmer
Jun 29, 2001
50
GB
Hi Everyone

I'm new here, so forgive me if this question has been asked before.

I want users to be able to edit reports in an application by using the MODIFY REPORT command, but I want to be sure that the Report Controls Toolbar is opened when they do this.

Is there any way this can be done without having a View/Toolbars option on the menu bar?

John B.
 
Hi!

Provide the resource file with your application that contain record for this toolbar and it is marked as readonly in the resource DBF (foxuser.dbf is a default name of that file).

This is a suggestion only...
Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
1. Launch Visual FoxPro.
2. Close any toolbars that you don't want the user to see at run-time (such as the standard toolbar).
3. Open the report designer.
4. Go to View/Toolbars and manually open the two main report designer toolbars (Report Designer and Report Controls).
5. Move these to a suitable location on the screen.
6. If you wish, you can also open the Layout and Color Palette toolbars at this point, but this is not essential as the user will be able to open these from the Report Designer toolbar.
7. Now .. Using Windows Explorer, visit the directory from which you launched VFP. Look for FOXUSER.DBF and FOXUSER.FPT, and make them read-only. (To make a file read-only, right-click on it, select Properties, and enable the Read-Only checkbox.)
8. Quit the report designer and close VFP.
9. Copy the two Foxuser files to the directory on the user's system from which your application will be launched.

You can also copy the FoxUser.* to Freport.* or such suitable name. Then at the appropriate place in your application, (may be at the click event of your Print button) issue the command, SET RESOURCE TO Freport and then after the printing is over, set it back to default or hatever way you control.

Best of luck :)
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
ezpzjohn

Just to explain how you can implement Vlad's suggestion of making the records relating to the toolbar read-only in the foxuser.dbf, try the following.

Modify your report positioning toolbars etc and save.

At the command window:-

SET RESO OFF
USE path\foxuser IN 0
INDE ON FOXUSER.updated TAG date
SET ORDER TO TAG date
GO BOTT
BROW

By indexing, you will be able to easily find the relevant records as they will be the last in the table.
The toolbar references will have "TTOOLBAR" as the value in the FOXUSER.id field.

Change the FOXUSER.readonly field values to .T.

Then:-

USE
DELE FILE path\foxuser.cdx

If you make foxuser.dbf read-only, you will lose a lot of its functionality in its ability to track the coordinates of windows, objects etc - you are also using a sledgehammer to crack the proverbial nut.

You can also use the techniques described above to "lock" or "unlock" other objects without knowing their FOXUSER.id values upfront.

HTH

Chris :)
 
Many thanks to Vlad, Ramani and Chris for your help. I have some more experimenting to do with SET RESOURCE but it sure seems to work so far! I will be going for the option of creating my own resource file to ship with the app and making the required toolbar record(s) in it read only.

Thanks again

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top