report tool bar  
Author Message
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

After a report is generated and appears in a preview you get a small toolbar that floats undecked in full view of the info that you try to read. It was an annoyance until I had only 1 page in the report and once I moved the bar down the report page and believe it or not it DISAPPEARED behind the frame's lower edge. It was not a big alarm for me then since I had only one page but now I have many and the only way to flip pages as I can see is to get the toolbar back.

I cannot possibly retreive it no matter what I try.

When I moved the toolbar down I hoped that it would deck somewhere and become available as part of the frame but it is not what actually happened.

The toolbar disappeared at design stage but the same form's report appears toolbarless after I built an exec.

Looking for help.

Thanks




Visual FoxPro2  
 
 
CetinBasoz





PostPosted: Visual FoxPro General, report tool bar Top

Add:

resource=off

to config.fpw


 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

I am sorry, Cetin, it did not work. The resource was originally set ON, I tried OFF for it but it did do nothing, so I reverted it back to ON. I remember that I set it ON for some reason but do not recall why now--too many things have happened since then.

I also invoked the print preview toolbar via View->Toolbars and tried to customize it. It did not help either. The toolbar is still conspicuously absent when I preview my reports and I can see only one page. Other pages are inaccessible.

Thanks.



 
 
CetinBasoz





PostPosted: Visual FoxPro General, report tool bar Top

Strange. Then try:

use sometable && something that you created a report form for
report form .... preview nowait

DOCK WINDOW "Print Preview" POSITION 0


 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

Sorry, it did not work either. I also tried

DOCK WINDOW "Print Preview" POSITION -1 and then the statement you suggested with POSITION 0 because of a note in the help DOCK command that the window must be first undocked with POSITION -1.

Also I do not quite understand why you are trying to DOCK Print Preview window not the toolbar window. I have no trouble with Print Preview.

It is possible to bring up the toolbar using View-->Toolbars sequence. Then the Print Preview toolbar gets positioned on the SCREEN surface but once I click the button that generates Print Preview the toolbar immediately disappears and I cannot get it back no matter what I do.

Thanks.



 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

Hi Cetin,

I've spent a bit of time studying the subject. It appears it may be possible to create a custom toolbar object and use it any way I choose but I will need your help as to how to bind it to the Print Preview window and make it flip pages. I do not really need anything else for it to do.

Thanks.



 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

I just tried to generate a toolBar like this and got an error at the second statement: the object is invalid for this container.

REPORT FORM MyReport.FRX NAME repForms PREVIEW NOWAIT
repForms.AddObject ("cToolBar",'ToolBar')

Thanks.



 
 
CetinBasoz





PostPosted: Visual FoxPro General, report tool bar Top

A toolbar itself is a form. You can't addobject it to a form but you can instead AddProperty (property would be a reference to toolbar). Sorry I didn't understand at all your other messages. I thought you were talking about Print preview toolbar.
 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

Yes, I was talking about Print Preview Toolbar all the time but it seems you recommended to dock Print Preview, not the Toolbar. There was no command to generate the toolbar in my form and therefore there was no reference to it, so when you issue DOCK you have to have a name for the toolar to dock it, Yes But there is no name.

Thanks.



 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

repForms.AddProperty ('ToolBar')

did not generate an error but neither did it produce a toolbar.

Thanks.



 
 
CetinBasoz





PostPosted: Visual FoxPro General, report tool bar Top

I don't understand the difference between "Print Preview" and "Print Preview" toolbar. A toolbar is a form and thus a window, no They're the same thing IOW.

If it's missing in the first place then first show it (turning resource off would do it but you say it doesn't, it does for me since maybe VFP3.0).

repForms.AddProperty ('ToolBar')

yes you added the property but didn't assign a value

repForms.AddProperty ('ToolBar', oToolBar)

oToolbar is the reference to toolbar that you created. ie:

oToolbar = newobject("myToolBar","myClassLib")


 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

OK, I feel there is a communication problem somewhere. What I saw until a few days ago was this: After I issued a REPORT command I had a form (PRINT PREVIEW form) sprang up overlapping my main form where I could view my report. The report in this print preview form was set at page # 1. There was also a tiny secondary form with a few controls on it: the toolbar. One of the controls allowed me to magnify or attenuate the report. It was a combobox with percentages: 25%,50%,75%,100%,125%,150%, etc. The other one was a navigation button (actually two buttons: right and left). With this second control which I badly miss now I could flip the pages.

As I said, once I moved it down below the page because it was hindering my view and it disappeared forever.

Now after I read your suggestions I did the following: I generated a custom toolbar and hooked it to my custom library: myDefines.cvx. Then I assigned it as a new property to the form preview.

REPORT FORM MyReport.FRX NAME repForms PREVIEW NOWAIT
oToolbar = newobject("myToolBar","D:\VFP_PR~1\LIBS\mydefines.vcx")
repForms.AddProperty ('ToolBar',oToolBar)
oToolBar.Show ()

At design stage it does generate a "toolbar" which has no controls on it, naturally, It is just a tiny form placed at the corner of the _SCREEN. For all practical purposes it is useless in this shape but it is not the worst part. I could have tried to figure out how to fill it with controls I need. The worst part is that after I BUILT an exec out of my main form this toolbar did not show up at all in the Preview.

I am back to the square one.

I appreciate your help as always.

Thanks.



 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

"If it's missing in the first place then first show it (turning resource off would do it but you say it doesn't, it does for me since maybe VFP3.0)."

I did it again, setting the RESOURCE = OFF. It did nothing. There was no toolbar. Now I recall why I set it ON--it hindered my development screwing the position of the Project Manager: Every time I close the project and open it back up again it would be in the left upper corner of the screen. I do not want it.

Thanks.



 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

I have solved the problem. It was actually very easy. It puzzles me however why that "toolbar" somehow worked in the first place and then disappeared. It is controlled by this statement:

SET REPORTBEHAVIOR 90

I had to set aside my other C# project for an hour and concentrate on studying the damn thing. Finally I stumbled on it.

Now that "toolbar" or whatever you call it, I wish I knew the proper term for it, shows up as clockwork and never fails. The whole thing works beautifully.

Many thanks to Cetin for help.



 
 
AlexBB





PostPosted: Visual FoxPro General, report tool bar Top

You know it is a mystery. My joy was short-lived. After I closed the form and invoked it back up again the toolbar is there but shows up for a fraction of a second and then disappears! What is going on

At least now the RANGE clause works, it seems. Now I can I can at least read other pages if I set RANGE 2 (or else) as a starting page. Before I included the REPORTBEHAVIOR 90 the range did not work, but it is the way it is supposed to be.

Could you try to solve the puzzle