Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Report going to default printer no matter what the setti
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00929314
Message ID:
00929389
Vues:
13
>Get rid of the device and output information (see below). Here's a FAQ on the subject, don't know how reliable the code is (I wrote my own).
>
>VFP8 has the ability to save the report without that stuff in it.
>
>Why won't my report print to the SET PRINTER TO NAME printer? FAQ #7840

I am working with VFP7.

I read the code from FAQ #7840 Steve refered to me and pasted below. There aren't definitions for dHardReturn,dNULString.

So I used the chr(13) for dHardReturn and chr(0) for dNULString. But it still prints to the default printer.

There is only one way that the report doesn't to go to the default printer that is if I include the target printer information in the report's expr,tag,tag2 by selecting the target printer Printer Setup when modifying the report.

Why doesn't SET PRINTER TO NAME do it's job even when I clear Printer information from report file?
LPARAMETERS cOutputName, nBuildAction, lRebuildAll, lShowErrors, lBuildNewGuids
LOCAL loCurrentProject
LOCAL lcOldALIAS
LOCAL lnCounter

loCurrentProject = APPLICATION.ActiveProject
lcOldALIAS = ALIAS()

WITH loCurrentProject
   WITH .Files
      SELECT 0
      WAIT WINDOW "Looking for FRXs to scrub . . ." NOWAIT
         FOR lnCounter = 1 TO .Count
             WITH .Item(lnCounter)
                  IF .Type = FILETYPE_REPORT
                     WAIT WINDOW "Scrubbing FRXs . . ." NOWAIT
                     USE (.Name) ALIAS ReportFRX
                     lcExpr = "COPIES=1"
                     lnOrientation = ATC("ORIENTATION", ReportFRX.Expr)
                     IF lnOrientation > 0
                        lcExpr = lcExpr + ;
                                 dHardReturn + ;
                                 "ORIENTATION" + ;
                                 SUBSTR(ReportFRX.Expr, ;
                                        lnOrientation + 11, 02)
                     ENDIF
                     REPLACE ReportFRX.Expr WITH lcExpr, ;
                             ReportFRX.TAG  WITH dNULString, ;
                             ReportFRX.TAG2 WITH dNULString
                     USE IN ReportFRX
                  ENDIF
             ENDWITH
         ENDFOR
         WAIT CLEAR
    ENDWITH
ENDWITH
IF NOT EMPTY(lcOldALIAS)
    SELECT (lcOldALIAS)
ENDIF
DODEFAULT(cOutputName, nBuildAction, lRebuildAll, lShowErrors, lBuildNewGuids)
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform