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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Dock the Report Preview Toolbar through code 2

Status
Not open for further replies.

tamayok

Programmer
Sep 4, 2001
99
PR
Hello to all,

I would like to automatically dock the Report Preview Toolbar through code. Is there a way?

The app. has RESOURCE=OFF as a setting and, I do not want to distribute FoxUser/Resource with my application just for that purpose.

I realize an archived thread ( exists for this very issue but it was not "resolved" back in 2002.

Many thanks!
 
tamayok,

Assuming you are using VFP 9 and the new reporting features (SET REPORTBEHAVIOR 90)...

The full source code for the reportpreview.pjx that is used in VFP 9 is included in XSource.zip located in...

C:\Program Files\Microsoft Visual FoxPro 9\Tools\xsource\

Extract that zip and you'll find...

C:\Program Files\Microsoft Visual FoxPro 9\Tools\xsource\VFPSource\ReportPreview\ReportPreview.pjx

Now, open that project and find the frxpreview.vcx that has a frxpreviewform class in it. That class has a ShowToolbar method and you can modify the code in there to always dock the toolbar no matter if it is a top level form or not.

Once you've made the change, compile the project to something like CustomPreview.app and then in your VFP 9 application make sure to issue the following in your main.prg...

_ReportPreview = "CustomPreview.app"

This will force VFP 9 to use the new customized report preview application you've made that always docks the preview toolbar.

There may be some other code in the reportpreview project you have to modify to get it to stop saving user preferences (resource file). But, this is the basic gist of what's involved to do what you want here. Obviously you'll need to distribute CustomPreview.app with your application in lieu of ReportPreview.app.



boyd.gif

SweetPotato Software Website
My Blog
 
Thanks to both for the excellent alternatives!

No doubt we are using the finest product out there when even with very specific issues one can employ several ways to get the desired results.

With this one I particular, I will do THE RIGHT THING (jaja!): distribute FoxUser and code to toggle SET RESOURCE around the REPORT statements. After all, it should be the users choice to have a floating/undocked toolbar or not.

My stars to both for always investing your time and insight.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top