Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expr2 papersize
Message
From
02/12/2015 11:50:53
 
 
To
02/12/2015 11:47:50
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01628266
Message ID:
01628296
Views:
43
I created and tested the code because we had a similar discussion on Aruba. I am not sure whether the code was incorporated into any finished product. I don't remember all the details, but I think you are right in your assumptions.

>Shurly your code is working. No doubt.
>Your code is changing the expr2 field of the first record of an frx, right? Just the same as USE the frx and alter the Expr2 memo field?
>This will not move any field. If you start with something small like letter A4 will end up with a wider right margin.
>IOW a A4 report that is with a 5mm right margin needs to be reworked to fit into Letter (all landscape, portrait is the other way around).
>
>At least this is what I observe.
>
>>My code will work, but that doesn't necessarily mean that the reports look perfect on the paper size that it's not designed for. So for instance margins will be changed a little bit. I seem to remember that my program works best if the reports are consistently designed for one of the paper sizes, but I don't remember which. On Aruba letter size was most common where I worked, so the reports I tried were most likely designed for letter originally. It's really amazing how quickly you forget stuff. :-)
>>
>>>So you have a report that left a right border on A4 Landscape or Letter Portrait? At least a report that is A4 Landscape with 5mm right margin will not work as a Letter.
>>>I simply remove the papersize from expr2 and it will be cut where the printer tells the reportengine. I have some ugly label printer that work this way.
>>>
>>>It's a problem with an external company that tries to cheat a bit.
>>>
>>>
>>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform