Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Foxpro HTML report listener: how to get rid of messages 1

Status
Not open for further replies.

clmcgrath

Programmer
Mar 5, 2011
5
US
I am trying to use the HTML report listener within one of my forms. It works great except it keeps displaying listener messages. Any idea how to get rid of those? I thought using quietmode = .T. would work. No such luck.

Here is my code:

cfile = ALLTRIM(mfiled)+"\"+ALLTRIM(hrpt) +'-'+dtos(DATE())+ ".HTML"
ox = .NULL.
do (_reportoutput) with 5, ox
ox.TargetFileName = cfile
ox.QuietMode = .T.
ox.ListenerType = 5
REPORT FORM (hrpt) OBJECT ox

When the Report form command runs, it generated my html file perfectly but also displays the following messages on my form.

.T.
.NULL.
GFXNORENDER
LISTENER.VCX
LISTENER.VCX
LISTENER.VCX
End of Locate scope.
.F.
.T.
.T.
.NULL.

I have searched the internet and VFP help files and can't find anything on this topic. Anybody know how to suppress these messages?

Thanks for the help.
 
I assume the NOCONSOLE option of the REPORT FORM command should take care of that. But referring to the help this has no influence in the object assisted mode, if the reportlistener does not repect this setting given via command clauses.

You should try SET CONSOLE OFF anyway, also you can set form.AllowOutput = .f. to supress such output.

Report listener source code is in xsource available to you to modify otherwise.

This may already be ammended in the newer VFPX version of xsource at
Bye, Olaf.
 
I already have the Set console off option and as you stated it doesn't have an effect on the listener. I just tried the set form.AllowOutput = .f.. While it doesn't get rid of the messages, it does move them off my form and into the background. It isn't perfect, but it is better.

I am not big on modifying foxpro source code. This is really such a basic thing, I would think VFP would have an easy solution. Like some setting. I just can't find it.
 
Thanks for the suggestion, but I have status set to off. Doesn't seem to impact the listener.
 
That doesn't sound like SET STATUS, or SET CONSOLE, or anything else. If you go back to our Xbase roots that sounds like

SET TALK OFF

is missing.

Wasn't this a bug that was reported in one of the VFP releases, guys?
 
Dan,

can be, clmcgrath, do you use VFP9 without SP or with SP1, it might be corrected in SP2, there were some bugs in reporting removed.

You can also put _Screen.AllowOutput = .F. to turn output off there too.

Do you use classes/subclassing all your forms from a base form class? Then you can setAllowOutput .f. there to have all forms that way. If you don't use subclassing, start right now, this is very often a best solution to have one central base class all other classes inherit of, to set something in all objects derived.

Even if you don't make any other use of OOP, this is the one thing you can always do, class browser anables you to redefine your classes and also scx forms to be based on other classes than the native ones.

Bye, Olaf.
 
Clmcgrath,

What exactly are the messages you are seeing? Are you referring to the actual report output, or are these some sort of error messages?

If the latter, it could be similar to a problem I had last year. See thread184-1610016 for details.

I never found the cause of the problem, but I solved it satisfactorily by modifying the report listener code.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Presumably the ones included in the original post

Oops. That's what comes of skimming rather than reading.

On reflection, this looks very much like SET TALK OFF is needed.

Clmcgrath, put that command in the Load or Init of the form that calls the report. If that doesn't work, add it to the start of the report listener code. (The command is scoped to the data session, so it's not enough to put it in the main program.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks to everyone for their help. I actually used the _Screen.AllowOutput = .F. as Olaf suggested and got rid of the white foxpro screen that appeared behind my application by using the config file. I think that put the messages somewhere in the background that can no longer be seen. It worked!

THe article above probably works also. It's just a bit more techy. :)

Thanks again for the suggestions.
 
Well, all the article of Cathy Pountney says is:

Modify the fxListener class of the _ReportListener class library and change the code in the LoadReport method. Simply move This.setFRXDataSessionEnvironment() so it comes before This.createHelperObjects() and the problem is solved.

CD HOME()+"FFC"
Modify Class fxListener Of _reportlistener.vcx

Now go.

Bye, Olaf.
 
Clmcgrath,

It's good that you have made the problem go away, but I really think you should adopt Cathy Pountey's solution rather than the one you did.

What you have done is to hide the effects of the problem. With Cathy's suggestion, you would actually solve it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
I don't normally like to add to a pileup, but here I will.

You've been given a proper fix that will fix it this time AND EVERY TIME IT EVER COMES UP, but you've chosen to hide it just for this time. You're betting that the next time it comes up, someone here will either remember this thread or Cathy's blog post.

(At our collective ages, relying on memory isn't the best bet.)

Fix the problem once and for all. It's seriously easy.
 
OK, I loaded the _reportlistener and looked at the LoadReport method. There is no This.createHelperObjects() line. Below is the code. Unless I'm looking in the wrong place, the blog advice does not appear to be helpful.

THIS.clearErrors()

THIS.setFRXDataSessionEnvironment()

THIS.resetDataSession()
THIS.frxHeaderRecno = -1

IF NOT ISNULL(THIS.Successor)
WITH THIS.Successor
.AddProperty("isSuccessor",.T.)
.AddProperty("commandClausesFile",THIS.commandClausesFile )
.PrintJobName = THIS.PrintJobName
.CommandClauses = THIS.CommandClauses
.LoadReport()
ENDWITH
ENDIF
 
You are looking at the LoadReport method of the _ReportListener class (in the _ReportListener class library).

You need to be looking at the fxListener class (of the _ReportListener class library). Use Olaf's code and it will open the right class.

Here is the LoadReport method in my copy:

Code:
* always start with full reset for this run:
THIS.CallAdjustObjectSize = LISTENER_CALLDYNAMICMETHOD_NEVER
THIS.CallEvaluateContents = LISTENER_CALLDYNAMICMETHOD_NEVER
THIS.commandClausesFile = THIS.CommandClauses.File

* see notes in BeforeReport
THIS.createHelperObjects()
THIS.checkCollectionMembers()
THIS.setFRXDataSessionEnvironment() 
THIS.sendFX(PROGRAM())  

NODEFAULT
RETURN DODEFAULT() && these changes can be passed on to successors

 
Hi clmcgrath,

Code:
CD Home()+"FFC"
Modify Class fxListener Of _reportlistener.vcx

is code you should have executed, not broken english of a non native english speaker. ;)

Bye, Olaf.
 
We can make that even easier, actually:

Code:
CD HOME()+"FFC"
Modify Class fxListener Of _reportlistener.vcx METHOD LoadReport
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top