Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Driver question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Divers
Thread ID:
00120568
Message ID:
00120928
Vues:
15
>I created a vfp report using a LaserJet 4L driver and the report works fine. When I port the application to a machine with a LaserJet 6P printer, the printer hangs when attempting to print the report. Is this a vfp problem or do I have something wrong with my system/hardware?


Heres a bit of code I wrote to clean up the fields necessary for printing.
*---------------------------------------------------------------FUNC FIXREPORT
FUNCTION fixReport
**
** PURPOSE : strips the default printer from the passed report in the *current directory
** PARAMETERS: lcReportName
** MEMVARS : none
** RETURNS : nothing
** SAMPLE : do fixReport with myreport.frx
**
lparameters lcReport
local lcExpr, lcLine, i, ii, lnSelect
lnSelect = select()

if right(upper(lcReport), 4) != '.FRX'
lcReport = lcReport+ '.FRX'
endif

select 0
use (lcReport) alias xReport
locate for objType = 1 .and. objCode = 53
if found()
repl Tag with "", Tag2 with ""
*-- next fix the Expr
lcExpr = ''
lnLines = memLines(xReport.expr)

if lnLines > 0
for ii = 1 to lnLines
lcLine = upper(mline(expr, ii))
do case
case 'DRIVER=' $ lcLine
case 'OUTPUT=' $ lcLine
case 'PRINTER=' $ lcLine
case 'DEVICE=' $ lcLine
otherwise
if !empty(lcExpr)
lcExpr = lcExpr + chr(13)
endif
lcExpr = lcExpr + lcLine
endcase
endfor
repl xReport.expr with lcExpr
endif
endif
use

select (lnSelect)
return

*just pass the name of the report to the proc. It will strip out the DRIVER, OUTPUT, PRINTER and DEVICE = in each of the memo fields while leaving the rest of the field content in tact. I use it all the time. Your reports will go to the default windows printer.

Robert.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform