×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

FoxyPreviewer Print Tool Bar

FoxyPreviewer Print Tool Bar

FoxyPreviewer Print Tool Bar

(OP)
How can replace the Standard Print Tool Bar with FoxyPreviewer Print Tool bar before calling Report Form

RE: FoxyPreviewer Print Tool Bar

Isn't that automatically happening?

There should be some readme or howto with foxypreviewer and how to use it. The simplest usage is to DO FOXYPREVIEWER.APP in your exe at startup and then REPORT FORM calls even without using some explicit foxypreviewer reportlistener will go through FoxyPreviewer handling of reports, including the print toolbar at print previews.

You could perhaps manage to start this toolbar without the preview, but it wouldn't help at all, as it needs the context of a preview, it interacts with the preview container window, for example, so don't try to go that route, that idea doesn't work out at all.

If you want to do stuff like printing to PDF without going through the preview and without instructing your users to use the Save tool from the FoxyPreviewer Toolbar, you have lots of options available in _screen.oFoxyPreviewer after DO FOXYPREVIEWER.APP. This enables you to configure the print behavior before printing and without preview.

Also search the web for sample usages.

Bye, Olaf.

RE: FoxyPreviewer Print Tool Bar

The way I have achieved this (if in fact it's what you're looking for) is to the put the following at the start of your .prg:

CODE -->

#DEFINE PrintFromPreview .F.
LOCAL loPreviewContainer AS FORM, ;
  loReportListener AS REPORTLISTENER, ;
  loExHandler AS ExtensionHandler OF SYS(16)

loPreviewContainer = NULL
DO (_REPORTPREVIEW) WITH loPreviewContainer
loReportListener = NEWOBJECT('ReportListener')
loReportListener.LISTENERTYPE = 1 &&Preview
loReportListener.PREVIEWCONTAINER = loPreviewContainer
loPreviewContainer.AllowPrintfromPreview = PrintFromPreview
loPreviewContainer.TextOnToolbar = .F.
loExHandler = NEWOBJECT('ExtensionHandler')
loPreviewContainer.SetExtensionHandler( loExHandler ) 

Then issue your relevant command:

CODE -->

REPORT FORM MYFORM PREVIEW NOCONSOLE FOR FIELDNAME="whatever" OBJECT loReportListener 

At the end of my .prg have the following:

CODE -->

DEFINE CLASS ExtensionHandler AS CUSTOM
	*-- Ref to the Preview Container's Preview Form
	PreviewForm  = NULL

	*-- Here you implement (hook into) the PreviewForm_Assign
	*-- event of the preview container's parent proxy
	PROCEDURE PreviewForm_Assign( loRef )
		*-- Perform default behavior: assign obj ref.
		THIS.PreviewForm = loRef

		*-- Grab the obj ref to the preview form and bind to its
		*-- ShowToolbar() method. This lets the
		*-- STB_Handler() method of this extension handler
		*-- to run code whenever the Preview toolbar is shown
		*-- by the PreviewForm.ShowToolbar() method.
		IF !ISNULL( loRef )
			BINDEVENT(THIS.PreviewForm, ;
				'ShowToolbar', THIS, 'STB_Handler')
		ENDIF
	ENDPROC

	PROCEDURE STB_Handler(lEnabled)
		*-- Here you work around the setting
		*-- persistence problem in the Preview toolbar. 
		*-- The Preview toolbar class (frxpreviewtoolbar)
		*-- already has code that you can use to enforce
		*-- setting's persistence; it is just not called. Here,
		*-- you call it.
		WITH THIS.PreviewForm.TOOLBAR
			.REFRESH()
			*-- When you call frxpreviewtoolbar::REFRESH(), the
			*-- toolbar caption is set to its Preview form,
			*-- which differs from typical behavior. You must revert that
			*-- to be consistent. If you did not do this,
			*-- you would see " - Page 2" appended to the toolbar
			*-- caption if you skipped pages.
			.CAPTION = THIS.PreviewForm.formCaption
		ENDWITH
	ENDPROC


	*-- A preview container requires these methods
	*-- to be implemented in an associated preview extension handler.
	*-- They are not used in this example, but still must be here.
PROCEDURE AddBarsToMenu( cPopup, iNextBar )
	PROCEDURE SHOW( iStyle )
	ENDPROC
	PROCEDURE HandledKeyPress( nKeyCode, nShiftAltCtrl )
		RETURN .F.
	ENDPROC
	PROCEDURE PAINT
	ENDPROC
	PROCEDURE RELEASE
		RETURN .T.
	ENDPROC

ENDDEFINE 

This is how the foxypreviewer instructions suggested and it works for me.

RE: FoxyPreviewer Print Tool Bar

That was perhaps necessary with an early version, but look at this: http://weblogs.foxite.com/vfpimaging/2011/04/19/th...

Quote:

The recommended mode - make it simple !!!
from now on, I'm recommending people to use only the simplified mode:

CODE

DO FoxyPreviewer.app
REPORT FORM YourReport PREVIEW 

Don't overcomplicate it. You even only need to do the FoxyPreviewer.app once at startup.
If you want to add to the toolbar, foxypreviewer comes with full source code PJX, simply change the toolbar as you like and recompile your own foxypreviewer.app

Bye, Olaf.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close