Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clearing values in EXPR, TAG, TAG2
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Clearing values in EXPR, TAG, TAG2
Miscellaneous
Thread ID:
00672346
Message ID:
00672346
Views:
45
Hello,

I have a user who complains that some of the reports are causing errors and crashes with her new printer. I figured I could clear out the DEVICE=, DRIVER=, OUTPUT= lines in the report's EXPR field and also clear out the tag and tag2 fields (the first record in the FRX table -- objtype = 1 AND objcode = 53). Below is the code I will use to do that.

Any comments, warnings, suggestions would be appreciated.
** ClearFRXsettings.prg
** right now gets a single file, will modify to process entire directory
Close data all
lcReportFile=getFile('frx','Get Report')
If not empty(lcReportFile)
	Use (lcReportFile) in 0 alias frxReport
	Select frxReport
	Locate FOR objtype = 1 AND objcode = 53
	If FOUND()
	** Find out how many lines in memo field. Find mline for DEVICE, OUTPUT, DRIVER delete these lines
		m.memolines= memlines(expr)
		nDeviceline=atcline("DEVICE=",expr)
		nOutputLine=atcline("OUTPUT=",expr)
		nDriverline=atcline("DRIVER=",expr)
		m.NewExpr=""
		For i = 1 to m.memolines
			If i#nDeviceline and i#nOutputLine and i#nDriverline
				m.NewExpr=m.NewExpr + mline(expr,i) +chr(013)
			Endif
		Endfor
		Replace expr with m.NewExpr
		Replace tag WITH ""
		Replace tag2 WITH ""
	Endif   (Found())
Endif  (not empty(lcReportFile)

Use in frxReport
Thanks,

Kevin
Kevin Emmrich
www.jkt9000.com
Next
Reply
Map
View

Click here to load this message in the networking platform