Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report form problem
Message
 
 
To
04/04/2005 12:11:40
Steve Jones
Business Systems Services Uk Ltd
Swansea, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01001208
Message ID:
01001251
Views:
15
This message has been marked as the solution to the initial question of the thread.
>Thanks Nadya,
>
>I have opened the report as a table and browsed it. In the tag\tag2 fields, they contain information about including a printer name (Also has printer name in Expr field).
>
>Should I just delete the information in these fields, or remove the printer name? How can I stop the printer name from being stored if this is what is causing the problem?
>
>Thanks
>
>Steve

You should remove information from TAG and TAG2 fields (e.g. replace with "") and for Expr field you should remove lines which are printer-specific and leave all other info. In VFP8 (9?) you have an option of not saving this information with the report. Prior to that version you have to do this clean up manually. Here is a program I used:
********************************************************************
*  Description.......: RemovePrinterSpecificInfo - Removes printer specific settings in report form
*  Calling Samples...: RemovePrinterSpecificInfo('All')
*  Parameter List....: pRepoForm
*  Created by........: Yuri Rubinov July 2000
*  Modified by.......: Nadya Nosonovsky 01/11/2002 01:51:06 PM
********************************************************************
parameter pRepoForm
local ia
if vartype(pRepoForm)#"C"
	pRepoForm=getfile("frx")
endif

do case
case upper(m.pRepoForm)#"ALL"
	pRepoForm=forceext(m.pRepoForm,"frx")

	if not file(m.pRepoForm)
		=messagebox("Report Form "+ m.pRepoForm +" not found?!",48,'Not found')
		return .f.
	endif
	do iClean
otherwise
	local array aa[1]
	local lcPath, lcFilter, DTitle, lcReportDir, lnFiles
	lcReportDir = '\redp\dbc\jobs\Reports'
	lcPath =''
	DTitle = "Select Report Files to Remove Printer Specific Info..."
* Text (*.txt)|*.txt|Pictures (*.bmp;*.ico)|*.bmp;*.ico
	lcFilter = "Report Files (*.frx)|*.frx|All Files (*.*)|*.*"
	lnFiles = File_Chooser(@aa, @lcPath, m.DTitle, m.lcReportDir, m.lcFilter)
	if m.lnFiles = 0 && User chooses Cancel
		return .f.
	endif
*!*
*!*		if adir(aa,"*.frx")<=0
*!*			=messagebox("No *.frx Report Forms found?!")
*!*			return
*!*		endif
	=asort(aa)
	for ia =1 to m.lnFiles
		pRepoForm=addbs(m.lcPath)+aa[m.ia]
		do iClean
	endfor
endcase

*----------------------------------
procedure iClean
local lcExpr, lnLines, lnI, CR
close table all
use (m.pRepoForm)
wait wind time 0.5 "Report form "+dbf()
=afields(afld)
CR=chr(13)
* the very first record only
if ascan(afld,"TAG")#0 and ascan(afld,"TAG2")#0 and ascan(afld,"EXPR")#0
	go top
*keep orientation and other stuff
    lnLines = alines(laLines,expr,.t.)
    lcExpr = ""
    for lnI = 1 to m.lnLines
        if "DEVICE" $ upper(laLines[m.lnI]) or "DRIVER" $ upper(laLines[m.lnI]) or "OUTPUT" $ upper(laLines[m.lnI])
            && this record should be removed
        else
           if "DEFAULTSOURCE" $ upper(laLines[m.lnI])
               laLines[m.lnI] = "DEFAULTSOURCE=7"   
           endif
           lcExpr = m.lcExpr + laLines[m.lnI]+ m.CR
        endif        
    next
*!*		if "orientation"$lower(expr)
*!*			lcOrient=substr(expr,at("orientation=",lower(expr))) && Remove the begining of the Expr field
*!*		endif	     
	replace tag with "", tag2 with "", expr with m.lcExpr
else
	=messagebox("File "+m.pRepoForm+". Not VFP6 format?!")
endif
use
*-----------------
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform