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

How to create a Print Preview toolbar to replace the default one.

Reports

How to create a Print Preview toolbar to replace the default one.

by  Mike Gagnon  Posted    (Edited  )
[ol][li]Create a program and place the following code in it.[/li]
Code:
Report Form C:\REPORT3.FRX Preview

Define Class MyToolBar As Toolbar
	Caption = "Print Preview"
	Add Object cmdTop As CommandButton With;
		caption = "Top"
	Add Object cmdBack As CommandButton With;
		caption = "Previous"
	Add Object cmdNext As CommandButton With;
		caption = "Next"
	Add Object cmdLast As CommandButton With;
		caption = "End"
	Add Object cmdZoom As CommandButton With;
		caption = "Zoom"
	Add Object cmdPrint As CommandButton With;
		caption = "Print"
	Add Object cmdQuit As CommandButton With;
		caption = "Quit"
	Procedure cmdTop.Click
	Keyboard "{HOME}"
	Endproc
	Procedure cmdBack.Click
	Keyboard "{PGUP}"
	Endproc
	Procedure cmdNext.Click
	Keyboard "{PGDN}"
	Endproc
	Procedure cmdLast.Click
	Keyboard "{END}"
	Endproc
	Procedure cmdQuit.Click
	Keyboard "{ESC}"
	This.Parent.Release()
	Endproc
	Procedure cmdZoom.Click
	Keyboard "Z"
	Endproc

Enddefine

Procedure removeWindow
If Wexist("Print Preview")
	Deactivate Window "Print Preview"
Endif
Endproc

[li]In the init of the dataenviroment of the report, put the following:[/li]
Code:
Public oTbr
oTbr = Createobject("MyToolBar")
oTbr.Visible = .T.

[li]In the "On entry" band of the page header of the report, put :[/li]
Code:
removeWindow()
[/ol]
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top