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!

FoxyPreviewer: Error when exporting to PDF, HTML, etc.

Status
Not open for further replies.

Mike Lewis

Programmer
Jan 10, 2003
17,511
Scotland
I am trying to use the "tagged formatting" feature in FoxyPreviewer. According to the docs, this allows you to apply some basic formatting (like bold and italic) to individual parts of a field. To do this, you place [tt]<TF>[/tt] in the field's user data, then surround the relevant text with HTML tags (like [tt]<i> ... </i>[/tt]).

This works perfectly. The formatting shows up correctly in the report.

However, when I try to export the report, I see this error message:

Error creating report data. The output will not be rendered correctly.

After clicking OK, the Debugger opens. If I then click Resume (in the Debugger) the export continues normally. And (as far as I can see), the output is completely correct. This happens when exporting to PDF, HTML and RTF (I haven't tried other formats).

I can see the offending code in the Debugger's Trace window. It consists of a MessageBox() followed by SET STEP ON.

I can live with this when I run my app for my own use. But I will eventually want to distribute it as an EXE. In that case, the SET STEP ON will ignored. But I won't want the message to come up.

Two questions:

- Has anyone seen this before?

- Any suggestions for how I might fix it.

Thanks in advance for any help.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike,

I found thia code to give a bit more context:
Code:
		SELECT OA.*, ; && OA = Output Alias
			TempFrx.* ;
				FROM (This.cOutputAlias) OA ;
				JOIN TempFrx ON OA.FrxRecno = TempFrx.nRecno ;
				WHERE FRXINDEX = m.n ;
				ORDER BY Page ;
				INTO CURSOR (m.laTempData(m.n)) READWRITE


		IF _TALLY = 0
			MESSAGEBOX("Error creating report data. The output will not be rendered correctly.", 16, "Error")
			SET STEP ON 
		ENDIF 
		USE IN SELECT("TempFRX")

I don't see this being triggered by usage of formatting, but when the report has no output data (i.e. when _TALLY=0, because the query has no result records). Can you debug this and see what data is queried here, especially whether the cOutputAlias is sensible at this stage?

Chriss
 
Thanks for your help with this, Chris. I'll delve a bit further.

Also, when I started this thread, I couldn't find the FP source code, but I then went back to the original download, and found the source there. So I could simply remove the error message and re-compile the APP, but I'm reluctant to do that in case it causes unknown side effects.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike,

Do you have latest version v299z41?

IMHO, Cesar fixed a few bugs with <TF> in FP 3.0.

mJindrova
 
Mike said:
I'm reluctant to do that in case it causes unknown side effects.

I wouldn't be afraid of this. But the source code points out the problem is indeed 0 records in the report workarea, not <TF> formatting. So you should investigate the source of the problem more than the FP source code. Then, likely, you don't need to change anxthing, just before you report check you have records to report and you avoid the situation anyway.

Chriss
 
Martina,

Yes, I have version v299z41. I didn't see this listed in the bug fixes for 3.0, although I might have missed that. I am reluctant to spend money on 3.0 if it doesn't solve the problem, but I'll probably go ahead and do that anyway.

In any case, I'll email Cesar - not necessarily to expect him to fix it, but he mig0ht find the information useful.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Chris,

Yes, I can see that there is an intermediate cursor that has zero records, and I can see where this might be going wrong. But it's going to take a bit more work to see how to fix it.

It's definitely not the case that my report has zero records. I've often used FP in those circumstances, and it never produces an error; it simply declines to run.

I think that, for now, I will just comment out the MESSAGEBOX() and the SET STEP. And I'll check carefully that the report is still 100% correct.

For the benefit of anyone else faced with this problem, the code in question is around line 89 in the GetFullFRXData method of the DBListener class. This is for FP version v299z41. I'll also report it to Cesar.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

IMHO, cursor (This.aFRXTables(m.n)) has not data for <TF>. This cursor fill TFAddToOutput method in FoxyListener class.

mJindrova
 
I have the source for v3.152 and I found the above code referenced in two different class methods (both have the same method name) - class dbflistener and pr_htmllistener15. Both of these SQL SELECTs are in a FOR loop which creates multiple cursors based on the number of alias in use. So, the error that you are experiencing may also be in the current code base of V3.xxx. See screen shots below of code:

2_qgrnis.jpg


1_vit8am.jpg


Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top