Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preview Report - Jump to 75% Zoom programmatically
Message
 
 
To
12/03/2004 12:50:50
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00885593
Message ID:
00885785
Views:
9
Interesting development. here is the code I put in my dectivate:
ZOOM WINDOW "Report Designer" MAX 
MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
IF WEXIST("Page Preview")
	MESSAGEBOX("Exists")
ELSE
	MESSAGEBOX("Doesn't Exist")
ENDIF
I was testing for a window mentioned in the MSDN Librery. I got a messagebox Doesn't Exist but the preview toolbar didnt dock until I closed the messagebox.
ZOOM WINDOW "Report Designer" MAX 
MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
INKEY(.1)
IF WEXIST("Page Preview")
	MESSAGEBOX("Exists")
ELSE
	MESSAGEBOX("Doesn't Exist")
ENDIF
When I added a delay the toolbar failed to dock at all.

I also found another REPORT FORM command version.
   *******
   * This is the report form command that uses the IN WINDOW Clause.
   * Notice that it uses both WINDOW and IN WINDOW clauses. The WINDOW
   * clause tells the Print Preview window to take on the characteristics
   * of the window, while IN WINDOW tells in what window to display the
   * Print Preview window.
   *******
    REPORT FORM report_1 PREVIEW WINDOW printpreview IN WINDOW printpreview
>Thanks for the ideas Mike,
>
>I've tried it both ways now and it seems to work the same. My preview window will be sized to maximize but it is really NORMAL and I have to always doubleclick on the titlebar again to reduce it and then maximize it again in order to show the horizontal scrollbar....
>
>
>>There is a difference when you use IN WINDOW vs WINDOW.
>>Try it this way:
>>
REPORT FORM (rpttoview) &prescope FOR &forclause PREVIEW IN WINDOW PREVIEWFORM
>>
>>>The F3 key (even manually pressed with preview window open) does nothing. I think I am running into the same problem I am experiencing in another thread that I cannot get the horizontal scrollbar to be visible unless I manually click on maximize once the preview comes up (a separate issue). The F10 key does nothing either, only double-clicking in the preview window's title bar or clicking on maximize will actually maximize the form yet the form is the size of a maximized window. As soon as I issue the MOUSE DBLCLICK command in deactivate, the toolbar docks as I want it to but the form is no longer maximized 'literally'. The report designer window never exists - I've trapped for it throughout the entire process. The problem I have is that I send the report to window inside a form using:
>>>
>>>
>>>LOCAL oPreviewForm
>>>oPreviewForm = NEWOBJECT('PreviewForm', 'Pro32.vcx')
>>>REPORT FORM (rpttoview) &prescope FOR &forclause WINDOW PREVIEWFORM PREVIEW
>>>oPreviewForm.Release
>>>
>>>
>>>In the deactivate of the form, I have:
>>>
>>>
>>>*--Preview form class deactivate
>>>DODEFAULT()
>>>IF WEXIST('Report Designer') && <-never runs because it doesn't exist
>>>   MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"
>>>   INKEY(.1)
>>>   MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"
>>>ENDIF
>>>IF WEXIST('Print Preview')
>>>   MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
>>>ENDIF
>>>
>>>
>>>
>>>>Remove ZOOM WINDOW "Report Designer" MAX
>>>>Here is exactly what works for me. I create a program:
>>>>
>>>>
>>>>*YzoomIT.prg
>>>>IF WEXIST("Print Preview") AND NOT wexist("Printing...")
>>>>
>>>>	LOCAL lcsetresource
>>>>	lcsetresource=SET("resource")
>>>>	SET RESOURCE OFF		&&IMPORTANT, otherwise it will remember the last setting
>>>>		* (when set to MAX with Ctrl+F10) and next time will set it back
>>>>	keyboard '{Ctrl+F10}'   && remove it if you wish
>>>>
>>>>	KEYBOARD '{F3}' &&75%
>>>>*	KEYBOARD '{F3}{F3}' &&50%
>>>>*	KEYBOARD '{F3}{F3}{F3}' &&25%
>>>>*	KEYBOARD '{F3}{F3}{F3}{F3}' &&10%
>>>>	
>>>>        MOUSE DBLCLICK AT -0.1,0.2 WINDOW "Print Preview"
>>>>	
>>>>	SET RESOURCE &lcsetresource
>>>>
>>>>endif
>>>>
>>>>
>>>>
>>>>In the report title I added a field with expression yzoomit().
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Thanks for the idea. It starts out at 75% when the toolbar is still hovering over the print preview window and then when the print preview toolbar is docked, it jumps to 100%... I'm looking for any zoom window or any other commands that may be causing that...
>>>>>
>>>>>
>>>>>>For your first question try this:
>>>>>>IF WEXIST( "print preview" )
>>>>>>
>>>>>> ZOOM WINDOW "Report Designer" MAX
>>>>>> KEYBOARD '{F3}' &&75%
>>>>>> *KEYBOARD '{F3}{F3}' &&50%
>>>>>> *KEYBOARD '{F3}{F3}{F3}' &&25%
>>>>>> *KEYBOARD '{F3}{F3}{F3}{F3}' &&10%
>>>>>>
>>>>>>endif
>>>>>>
>>>>>>>Is there anyway when previewing a report to have the report open up at 75% zoom? My report preview is opened up in a form...
>>>>>>>
>>>>>>>Also, to dock the report preview toolbar I use the code MOUSE DBLCLICK AT -0.1,0.2 WINDOW "Print Preview" in the form's deactivate... and it works great. However, i would like to get rid of the flash that occurs because the toolbar opens up on top of the preview form and then docks... it also leaves a shadow image of where the toolbar was before it was docked... Anyway to hide it until it is docked?
>>>>>>>
>>>>>>>
>>>>>>>TIA,
>>>>>>>TRACY
Regards,

Mike

"We try to solve the problem by rushing through the design process so that enough time is left at the end to uncover the errors that were made because we rushed through the design process."
- Glenford Myers

If you're going through hell, keep going. - Walt Disney
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform