Article ID: 188887
Article Last Modified on 2/12/2007
* Start of code example
*
public oMain
oMain = CREATEOBJECT('main') && open main form
oMain.visible = .t.
CREATE TABLE table_1 (field1 C(10))
FOR lnI=1 TO 3
INSERT INTO table_1 VALUES ('xx')
ENDFOR
CREATE REPORT report_1 FROM table_1
**************************************************
*-- Class: main
*-- ParentClass: form
*-- BaseClass: form
*
DEFINE CLASS main AS form
Top = 0
Left = 0
Height = 165
Width = 220
DoCreate = .T.
Caption = "Main"
Name = "main"
opform = .F.
ADD OBJECT command1 AS commandbutton WITH ;
Top = 24, ;
Left = 24, ;
Height = 37, ;
Width = 157, ;
Caption = "Show Print Preview", ;
Name = "Command1"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 84, ;
Left = 24, ;
Height = 37, ;
Width = 157, ;
Caption = "Close", ;
Name = "Command2"
PROCEDURE command1.Click
oPForm = CREATEOBJECT('printpreview')
oPform.visible = .t. && open printpreview form
*******
* 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
ENDPROC
PROCEDURE command2.Click
thisform.release
ENDPROC
ENDDEFINE
*
*-- EndDefine: main
**************************************************
DEFINE CLASS printpreview AS form
ScaleMode = 3
Top = 0
Left = 0
Height = 454
Width = 641
ShowWindow = 2
DoCreate = .T.
Caption = "Print Preview Window"
Movable = .T.
TitleBar = 0
WindowState = 0
SizeBox = .F.
Name = "printpreview"
ENDDEFINE
*End of Sample code
Additional query words: kbvfp600
Keywords: kbhowto KB188887