AndrewMozley
Programmer
I have an application which generates a range of VFP 9.0 report from a .dbf file. Brief explanation :
I have a report layout e.g. ANMREP.frx which is designed to produce a report based on 2 tables ANMHead and ANMDetl.
My application reads a table, e.g. Myinvoice.dbf. Determines that this uses format ANMrep.frx. It builds up the tables ANMHead and ANMDetl with the fields which it knows are required by ANMREP.frx and calls REPORT FORM.
(The .frx file was developed based on the same sort of data that MyInvoice.dbf contains).
This normally works fine. However if Myinvoice.dbf does not contain all the fields which the report wants to print (maybe it was produced by an earlier version of the program), there is a run-time error from the VFP reporter, correctly saying something like "Variable Add2 not found".
This error is meaningful to me, the developer, but not so meaningful to an end-user, and I would like to trap the error and give a message (at least mentioning where in my program - the REPORT FORM command - it is failing).
Can I do this with ReportListener ? I have tried to get to grips with this via an article by Doug Hennig, which I sadly found rather obscure - the very first instruction in his example fails :
loListener = createobject('MyReportListener')
report form MyReport object MyReportListener
I appreciate I am starting from a position of great ignorance but would appreciate guidance. Thanks. AM
I have a report layout e.g. ANMREP.frx which is designed to produce a report based on 2 tables ANMHead and ANMDetl.
My application reads a table, e.g. Myinvoice.dbf. Determines that this uses format ANMrep.frx. It builds up the tables ANMHead and ANMDetl with the fields which it knows are required by ANMREP.frx and calls REPORT FORM.
(The .frx file was developed based on the same sort of data that MyInvoice.dbf contains).
This normally works fine. However if Myinvoice.dbf does not contain all the fields which the report wants to print (maybe it was produced by an earlier version of the program), there is a run-time error from the VFP reporter, correctly saying something like "Variable Add2 not found".
This error is meaningful to me, the developer, but not so meaningful to an end-user, and I would like to trap the error and give a message (at least mentioning where in my program - the REPORT FORM command - it is failing).
Can I do this with ReportListener ? I have tried to get to grips with this via an article by Doug Hennig, which I sadly found rather obscure - the very first instruction in his example fails :
loListener = createobject('MyReportListener')
report form MyReport object MyReportListener
I appreciate I am starting from a position of great ignorance but would appreciate guidance. Thanks. AM