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!

Adding toolbars to forms progrmatically 1

Status
Not open for further replies.

makpak

Programmer
Sep 22, 2002
9
US
We are using VFP 6.0. We are using a form and calling a report form from one of the methods. When we call the report form in preview mode, no toolbars appear. The only one we need is the Print Review Toolbar so that we can zoom, look at more than one page etc. Looked in help and everywhere we can think of but there does not seem to be a way to make the toolbar appear. Using the report form in preview is useless without the toolbar. Any ideas?

Thanks

Makpak
 
makpak

Try deleting (yes deleting) the FoxUser.dbf file. See if that solves the problem. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
To Mike Gagnon

Thanks for the tip. I forgot having to delete foxuser files to fix bizarre behavior in Foxpro 2.6.

Unfortunately, this did not solve problem.

If I suspend the prg. and do a modi repo command, the Preview Tool Bar does pop up.

Any other ideas?

Thanks
Makpak
 
makpak

Is this a top-level application? Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
To Mike Gagnon

Wow, fast response. Thanks.

We have not made an app for this form. It is simply single form calling the report form from a method added to the form. Does this answer your question?

Thanks
Makpak
 
makpak

I assume you are using the standard :
Code:
report form myReport.frx preview
or this:
Code:
PUBLIC oForm
oForm = CREATEOBJECT("Form")
WITH oForm
 .Caption = "whatever"
 .WindowState = 2    && Maximized
 .Show()
ENDWITH
REPORT FORM yourreport PREVIEW WINDOW (oForm.Name)
oForm.Release()


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
To Mike G.

Thanks for all your suggestions. I finally found that the only way to get the menu to display was to deac the form window, then preview in screen. Form is not modal.

Unfortunately, the zoom function is pretty useless because the report is too big at 100% and must be scrolled; at 75%, the report is unreadable. Is there any way to get a defined % so that you could enter say 89% or another number.

We did create a database with the report info and used a grid to display info and this works, but there are a significant number of different reports and the extra coding would consume a significant amount of time.

Thanks for all your help,

Makpak
 
makpak

Unfortunately, I have not found a way to tell the preview to open at 89%, or any other percentage for that matter. I was able to do that with Crystal Report. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
makpak


To understand it, keep in mind that the current toolbar status - that is, the visibility and location of the toolbars, and whether they are docked or floating - is stored in the VFP resource file. The resource file is in fact two files. By default, they are named FOXUSER.DBF and FOXUSER.FPT and can be found in the directory from which you launched the application.

With that in mind, here are the steps needed to ensure that the report designer toolbars are always visible at run-time:

[ol][li]Launch Visual FoxPro. Close any toolbars that you don't want the user to see at run-time (such as the standard toolbar). [/li]
[li]Open the report designer. Go to View/Toolbars and manually open the two main report designer toolbars (Report Designer and Report Controls). Move these to a suitable location on the screen. 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. [/li]
[li]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.) [/li]
[li]Quit the report designer and close VFP. [/li]
[li]Copy the two Foxuser files to the directory on the user's system from which your application will be launched. [/li]
[li]Launch the application on the user's system. When you open the report designer from within the application, you should see the toolbars just as you left them. [/li][/ol]
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top