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

Have a Top-Level preview report with a Top-Level application

Reports

Have a Top-Level preview report with a Top-Level application

by  Mike Gagnon  Posted    (Edited  )
1. In your main program, define a window:
Code:
DEFINE CLASS printpreview as Form
 titlebar = 0
 Showwindow = 2 &&Top level
 autocenter = .t.
 name = "PrintPreview"
 height = SYSMETRIC(2) && This will maximize the preview
 width = SYSMETRIC(1)&& This will maximize the preview
ENDDEFINE

2. In your command button (that generates the report)
Code:
PUBLIC oPrint
oPrint= CREATEOBJECT("printPreview")
oPrint.SHOW()
REPORT FORM COUNTRY.FRX PREVIEW WINDOW PrintPreview IN WINDOW PrintPreview NOWAIT && This is borrowed from rgbean
DO WHILE EMPTY(WONTOP()) OR ;
      'Printpreview' $ UPPER(WONTOP())
   DOEVENTS
ENDDO
IF VARTYPE(oPrint) = "O"
   oPrint.RELEASE()
ENDIF

Mike Gagnon
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