|
|
 | | From: | Bruce Beacham | | Subject: | Minimising Report Viewer and OGF - GPF | | Date: | Tue, 18 Jan 2005 20:41:20 +0000 |
|
|
 | Hi
This has been found elsewhere.
Minimising a report viewer form thereby causing another form's onGotFocus to attempt to close the form, can cause a GPF.
Save the code below to two files, tfs.wfm and tfs.rep. DO tfs.wfm Click the pushbutton to run the report. Minimise the report viewer window. A GPF ensues.
Note that when the report viewer form is minimised, focus passes to the form with the pushbutton. The pushbutton form's OGF handler's code triggers the GPF.
Note that if you comment out the OGF line which closes the viewerform, then run the code in a new instance of dBASE, it does not fail. Then, in the same instance of dBASE, reinstate that line of code and re-click the pushbutton. The GPF does not occur.
Bruce Beacham
****** Save as tfs.wfm *********** ** END HEADER -- do not remove this line // // Generated on 16/01/2005 // parameter bModal local f f = new tfiForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif
class tfiForm of FORM with (this) ongotfocus = class::form_onGotFocus height = 16.0 left = 82.5 top = 0.0 width = 40.0 text = "" endwith
this.PUSHBUTTON1 = new PUSHBUTTON(this) with (this.PUSHBUTTON1) onClick = class::PUSHBUTTON1_ONCLICK height = 1.0909 left = 10.1429 top = 3.2727 width = 15.2857 text = "Run report" endwith
function PUSHBUTTON1_onClick do tfi.rep return
function FORM_ONGOTFOCUS private r r = findinstance("tfireport") ? r if not empty(r) r.close() endif return endclass
**************
****** Save as tfs.rep *********** ** END HEADER -- do not remove this line // // Generated on 08/08/2003 // local r r = new TFSREPORT() r.render()
class TFSREPORT of REPORT this.TEMPFISH11 = new QUERY() this.TEMPFISH11.parent = this with (this.TEMPFISH11) left = 7710 top = 1245 sql = ; [select * from "c:\program files\dbase\plus\samples\fish.dbf" ] requestLive = false active = true endwith
with (this.printer) duplex = 1 // None orientation = 1 // Portrait paperSource = 15 paperSize = 9 resolution = 4 // High color = 1 // Monochrome trueTypeFonts = 3 // Substitute endwith
this.PAGETEMPLATE1 = new PAGETEMPLATE(this) with (this.PAGETEMPLATE1) height = 16837 width = 11905 marginTop = 1080 marginLeft = 1080 marginBottom = 1080 marginRight = 1080 gridLineWidth = 0 endwith
this.PAGETEMPLATE1.STREAMFRAME1 = ; new STREAMFRAME(this.PAGETEMPLATE1) with (this.PAGETEMPLATE1.STREAMFRAME1) height = 11592 left = 360 top = 1365 width = 9360 form.STREAMFRAME1 = form.pagetemplate1.streamframe1 endwith
this.STREAMSOURCE1 = new STREAMSOURCE(this) this.STREAMSOURCE1.GROUP1 = ; new GROUP(this.STREAMSOURCE1) with (this.STREAMSOURCE1.GROUP1) groupBy = "Name" headerEveryFrame = true endwith
with (this.STREAMSOURCE1.GROUP1.headerBand) height = 1300 beginNewFrame = true endwith
this.STREAMSOURCE1.GROUP1.headerBand.TEXTNAME1 = ; new TEXT(this.STREAMSOURCE1.GROUP1.headerBand) with (this.STREAMSOURCE1.GROUP1.headerBand.TEXTNAME1) height = 300 left = 30 top = 105 width = 9345 variableHeight = true prefixEnable = false alignHorizontal = 1 // Center fontSize = 24 fontBold = true text = {||"A Fish Called " + ; this.form.tempfish11.rowset.fields["name"].value} endwith
with (this.STREAMSOURCE1.GROUP1.footerBand) height = 250 endwith
this.STREAMSOURCE1.detailBand.TITLETEXTNAME1 = ; new TEXT(this.STREAMSOURCE1.detailBand) with (this.STREAMSOURCE1.detailBand.TITLETEXTNAME1) canRender = {||this.parent.firstOnFrame} height = 300 left = 1110 top = 75 width = 2880 prefixEnable = false suppressIfBlank = true text = "Name" endwith
this.STREAMSOURCE1.detailBand.TEXTNAME1 = ; new TEXT(this.STREAMSOURCE1.detailBand) with (this.STREAMSOURCE1.detailBand.TEXTNAME1) height = 293 left = 1065 top = 428 width = 2880 variableHeight = true prefixEnable = false text ; = {||this.form.tempfish11.rowset.fields["name"].value} endwith
this.firstPageTemplate = this.form.pagetemplate1 this.form.pagetemplate1.nextPageTemplate = ; this.form.pagetemplate1 this.form.pagetemplate1.streamframe1.streamSource = ; this.form.streamsource1 this.form.streamsource1.rowset = this.form.tempfish11.rowset endclass **************
|
|
|