Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printer controls
Message
De
30/11/2004 12:12:56
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00965670
Message ID:
00965759
Vues:
11
I hope Rakesh also reads your message.

>I just found that program. Here it is:
>
>********************************************************************
>*  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
>*-----------------
>
>
>>In my case I could clear the field completely, but I know that's not always the case. That's why I wrote that he may have to adjust my program to suit his needs. :-)
>>
>>>>In later versions of VFP this problem is fixed. For earlier versions I have this program called MODIREPORT, you may have to adjust it a little bit to suit your need. In stead of MODIFY REPORT XXX you enter DO MODIREPORT WITH 'mydir\myreport.frx'. You must always include the extension, and also the path if it's not in the default directory.
>>>>lparameters lcfile
>>>>IF PCOUNT()>0 and file(lcFile)
>>>>  modi repo (lcFile)
>>>>  USE (lcFile)
>>>>  REPLACE EXPR WITH "", TAG WITH "", TAG2 WITH ""
>>>>  USE
>>>>ENDIF
>>>>
>>>>
>>>>>when creating reports the name of the printer is automatically stored , it then becomes difficult to print the report on another printer , especially if the user changes his printer.
>>>>>
>>>>>i do know that we can open the report file as a table and remove the printer info but is there any program which can do this automatically or is there a way to not store this info in the first place.
>>>
>>>You should not completely clear the Expr field. Yuri Rubinov published a program to fix Expr field removing only printer specific info. Let me see, if I have modification of this program in my function library...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform