Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get rid of the printer icon in the preview toolbo
Message
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01030309
Message ID:
01031158
Views:
19
>Why I want to remove it ? Because when using the print button in the preview, the actual print is not always the same as the preview. A VFP7 bug ??

I don't know. I never used VFP7 from 6 I jumped to 8.
Try this:

1. Backup all your reports
2. Remove all Printer related information from REPORT.
Here a simple program I used to do this (I download it from here and modified according my needs):
* reportfix.prg 05-Dec-97
* Takeout the Printer specific information from a report file
repo_dir = GetDir("Choose report folder","Choose report folder","Clear reports",64)

IF EMPTY(repo_dir)
   MessageBox("You must choose a folder where FRX resides?")
   RETURN
ENDIF
repo_dir = ALLTRIM(repo_dir)
repo_dir = IIF(RIGHT(repo_dir,1)#"\",repo_dir+"\",repo_dir)

mmm = ADIR(mm_repo,repo_dir+"*.frx")
FOR asd = 1 TO mmm
    WAIT WINDOW "REPORT "+mm_repo[asd,1] NOWAIT
    ReportFix(repo_dir, mm_repo[asd,1])
NEXT
WAIT CLEAR
RETURN


FUNCTION ReportFix(lcDir,lcFile)

    i = at( '.', lcFile )
    if ( i > 0 )
       lcFile = left( lcFile, i-1 )
    endif

    lcFile = lcFile + ".frx"

    use (lcDir+lcFile) EXCLUSIVE
    replace Expr with DePrinter( Expr ), Tag with "", Tag2 with "", Environ WITH .f.
    use

RETURN

function DePrinter( lcExpr )
local lcLine, lcRetVal

lcRetVal = ""

for i = 1 to memlines( lcExpr )
   lcLine = mline( lcExpr, i )
   do case
      case "DRIVER=" $ lcLine
           lcRetVal = lcRetVal + "DRIVER=" + chr(13) + chr(10)
      case "OUTPUT=" $ lcLine
           lcRetVal = lcRetVal + "OUTPUT=" + chr(13) + chr(10)
      case "DEVICE=" $ lcLine
         * strip it
      case "PRINTQUALITY=" $ lcLine
         * strip it
      case "YRESOLUTION=" $ lcLine
         * strip it
      otherwise
         lcRetVal = lcRetVal + lcLine + chr(13) + chr(10)
   endcase
endfor

return lcRetVal
Then try:
REPORT FORM YourReport TO PRINTER PROMPT PREVIEW
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform