I am using Mile Gagnon's post, listed below to preview a report in a top level form, which may have another form already open in it.
It works fine, except I cannot seem to control the width of the "PrintPreview" object. Using the Sysmetric() function looks strange on a large monitor. Is it possible affected by the size of the report when it is previewed.?
Sam
[============================================]
thread184-1632960
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)
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
[============================================]
It works fine, except I cannot seem to control the width of the "PrintPreview" object. Using the Sysmetric() function looks strange on a large monitor. Is it possible affected by the size of the report when it is previewed.?
Sam
[============================================]
thread184-1632960
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)
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
[============================================]