** 报表扩展功能示例 ASTACKINFO(a程序) SET DEFAULT TO ADDBS(JUSTPATH(a程序[2])) CREATE CURSOR tt (ff I) FOR i = 1 TO 100 INSERT INTO tt VALUES (i) ENDFOR oPC = NULL DO (_REPORTPREVIEW) WITH oPC oPC.Top = 0 oPC.Left = 0 oPC.Width = 800 oPC.Height = 500 oPC.Caption = "报表扩展功能示例" oPC.CanvasCount = 1 oPC.ToolbarIsVisible = .T. oPC.ZoomLevel = 5 && 100% oRP = NEWOBJECT("MyRetroPreview") oPC.SetExtensionHandler(oRP) oRL = NEWOBJECT("Reportlistener") oRL.ListenerType = 1 oRL.PreviewContainer = oPC REPORT FORM 报表扩展功能示例.frx OBJECT oRL RETURN DEFINE CLASS MyRetroPreview AS Custom PROCEDURE Show(iStyle) this.PreviewForm.Toolbar.addobject("myCmd", "CommandButton") this.PreviewForm.Toolbar.myCmd.Width = 80 this.PreviewForm.Toolbar.myCmd.Height = 22 this.PreviewForm.Toolbar.myCmd.Caption = "我的按钮" this.PreviewForm.Toolbar.myCmd.Visible = .T. BINDEVENT(this.PreviewForm.Toolbar.myCmd, "Click", this, "myCmdClick") ENDPROC PROCEDURE myCmdClick MESSAGEBOX("点击了我的按钮") ENDPROC ENDDEFINE