Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Expr2 papersize
Message
De
02/12/2015 09:54:22
 
 
À
02/12/2015 09:40:24
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01628266
Message ID:
01628268
Vues:
66
I can confirm this. When working on Aruba a few years ago, they used to have two set of reports, one for letter and one for A4. I created a simple program which used only one set of reports and simply changed the paper size value in expr2. It worked fine in all the cases I tried. This is my little program, which you call just before you run the report. I haven't used it for a long time, but from memory, the call is "replace expr2 with Changepapersize(expr2, 'legal')" and "replace expr2 with Changepapersize(expr2, 'A4')" respectively. The program also preserves the other values in expr2.
*Changepapersize.prg
Lparameters pcData, pcPapersize
Local laArray[1], ;
   lcNewValue As String, ;
   lcReturn As String, ;
   lcVariable As String, ;
   llChanged As Boolean, ;
   lnArraylen As Number, ;
   lnCounter As Number
lcReturn = []
If Vartype(pcData) # [C] Or Vartype(pcNewValue) = [C] Or Empty(pcPapersize)
   Return pcData
Endif
Do Case
   Case Upper(pcPapersize) = [LEGAL]
      lcNewValue = [5]
   Case Upper(pcPapersize) = [A4]
      lcNewValue = [9]
   Otherwise && 'Letter'
      lcNewValue = [1]
Endcase
#Define crlf Chr(13)+Chr(10)
lcVariable = [PAPERSIZE]
lcNewValue = lcVariable + [=] + lcNewValue
lnArraylen = Alines(laArray, pcData)
For lnCounter = 1 To lnArraylen
   If Upper(Getwordnum(laArray(lnCounter), 1, [ =])) == lcVariable
      laArray(lnCounter) = lcNewValue
      llChanged = .T.
      Exit
   Endif
Endfor
For lnCounter = 1 To lnArraylen
   lcReturn = lcReturn + laArray(lnCounter)
   If lnCounter < lnArraylen
      lcReturn = lcReturn + crlf
   Endif
Endfor
If !llChanged
   lcReturn = lcReturn + crlf + lcNewValue
Endif
Return lcReturn
>Hi Folks
>
>do we have a list what papersize values are valid?
>
>I have a strange co-developer that claims that a setting of 9 will scale a report according to the papersize of the printer? So that a DIN A4 will scale to Letter?
>
>Do you confirm that I need to have two reports to nicely fitt both formats?
>
>Lutz
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform