Visual Fox Pro在预览我的报表打印预览时出现语法错误。

huangapple go评论49阅读模式
英文:

Visual Fox Pro Syntax Error when Previewing my Report print preview

问题

抱歉,我无法执行代码部分的请求。以下是您要翻译的文本:

"Hi Good day! Visual Fox Pro 9 Syntax Error
Is there someone encounter this kind of error in visual fox pro 9? Once I edit my Report file or .frx file for my print preview format and build it again, I cant preview my Print Preview Report.
I already check all the codes, and there's no wrong spelling etc..."

请注意,图片链接无法进行翻译。

英文:

**Hi Good day! Visual Fox Pro 9 Syntax Error

Is there someone encounter this kind of error in visual fox pro 9? Once I edit my Report file or .frx file for my print preview format and build it again, I cant preview my Print Preview Report.
I already check all the codes, and there's no wrong spelling etc...enter image description here
Can someone help me with this problem? I already check my program file

答案1

得分: 2

如果你在IDE中打开报告(修改报告)并右键点击预览,如果出现问题,报告设计师会显示哪个元素有问题。

显然,为了使其有用,你需要在尝试预览之前设置报告所需的数据。有时候,我会暂时将提供报告的例程中的调用从REPORT FORM ... 更改为MODIFY REPORT ...,这样我只需运行应用程序,然后转到报告生成的位置。当报告设计师打开时,我右键点击并选择预览。

Tamar

英文:

If you open the report in the IDE (MODIFY REPORT) and right-click, Preview, if there's a problem, the Report Designer will show what element has the problem.

Obviously, to make this useful, you'll need to set up the data the report needs before trying to preview. Sometimes, I temporarily change the call in the routine that provides the report from REPORT FORM ... to MODIFY REPORT ..., so I can just run the application, and go to where the report is generated. When the Report Designer opens, I right-click and choose Preview.

Tamar

答案2

得分: 1

我建议创建一个所谓的错误处理程序,以查找可能导致你观察到的错误或其他错误的代码部分/行,例如通过使用类似于VFP F1帮助文件中显示的示例或在你的"main.PRG"的顶部附近的某个地方运行类似以下行:

ON ERROR do ErrorHandler with ERROR(), MESSAGE(), MESSAGE(1), PROGRAM(), LINENO()

并在你的main.PRG底部附近放置类似以下示例的过程:

PROCEDURE ErrorHandler
	LPARAMETERS tnError, tcMessage, tcMessage1, tcProgram, tnLineNo

	LOCAL lcErrorMessage
	lcErrorMessage = ;
		"Error No: " + TRANSFORM(m.tnError) + CHR(13) + ;
		"Message: " + TRANSFORM(m.tcMessage) + CHR(13) + ;
		"Code: " + TRANSFORM(m.tcMessage1) + CHR(13) + ;
		"Method: " + LOWER( TRANSFORM(m.tcProgram) ) + CHR(13) + ;
		"Line: " + TRANSFORM(m.tnLineNo)

	LOCAL lcLogMessage
	lcLogMessage = ;
		REPLICATE(CHR(13),3) + REPLICATE("*",5) + SPACE(1) + ;
		TRANSFORM(DATETIME()) + CHR(13) + CHR(13) + ;
		m.lcErrorMessage

	LOCAL loErrorMgr as ErrorMgr OF Libs\cmMgr.vcx
	loErrorMgr = NEWOBJECT('ErrorMgr','Libs\cmMgr.vcx')

	LOCAL lcLogFile
	IF VARTYPE(m.loErrorMgr) = 'O'
		lcLogFile = m.loErrorMgr.GetErrorLogFile()
	ELSE
		lcLogFile = C_ERRORLOGFILE
	ENDIF

	TRY
		STRTOFILE(m.lcLogMessage,m.lcLogFile,1)
	CATCH
	ENDTRY

	LOCAL lcMessage
	lcMessage = ;
		"Sorry, an unexpected Error occurred" + CHR(13) + ;
		"and was logged."
	MESSAGEBOX(m.lcMessage, 16, C_APPNAME)
	RETURN
ENDPROC
英文:

I'd suggest to create a so called Error Handler procedure in order to find the piece/line of your code that would cause the error you observed or any other, for example by using something like the examples shown in the VFP F1 Help file or running something like the following line somewhere close to the top of your "main.PRG" (i.e. the one that is the bold "main" member of yourProject.PJX):

ON ERROR do ErrorHandler with ERROR(), MESSAGE(), MESSAGE(1), PROGRAM(), LINENO()

and placing a procedure like the following example close to the bottom of your main.PRG:

PROCEDURE ErrorHandler
	LPARAMETERS tnError, tcMessage, tcMessage1, tcProgram, tnLineNo

	LOCAL lcErrorMessage
	lcErrorMessage = ;
		"Error No: " + TRANSFORM(m.tnError) + CRLF + ;
		"Message: " + TRANSFORM(m.tcMessage) + CRLF + ;
		"Code: " + TRANSFORM(m.tcMessage1) + CRLF + ;
		"Method: " + LOWER( TRANSFORM(m.tcProgram) ) + CRLF + ;
		"Line: " + TRANSFORM(m.tnLineNo)

	LOCAL lcLogMessage
	lcLogMessage = ;
		REPLICATE(CRLF,3) + REPLICATE("*",5) + SPACE(1) + ;
		TRANSFORM(DATETIME()) + CRLF + CRLF + ;
		m.lcErrorMessage

	LOCAL loErrorMgr as ErrorMgr OF Libs\cmMgr.vcx
	loErrorMgr = NEWOBJECT('ErrorMgr','Libs\cmMgr.vcx')

	LOCAL lcLogFile
	IF VARTYPE(m.loErrorMgr) = 'O'
		lcLogFile = m.loErrorMgr.GetErrorLogFile()
	ELSE
		lcLogFile = C_ERRORLOGFILE
	ENDIF

	TRY
		STRTOFILE(m.lcLogMessage,m.lcLogFile,1)
	CATCH
	ENDTRY

	LOCAL lcMessage
	lcMessage = ;
		"Sorry, an unexpected Error occurred" + CRLF + ;
		"and was logged."
	MESSAGEBOX(m.lcMessage, 16, C_APPNAME)
	RETURN
ENDPROC

huangapple
  • 本文由 发表于 2023年6月1日 13:55:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76379026.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定