Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change printer in report designer
Message
De
30/01/2013 03:12:06
 
 
À
30/01/2013 02:31:35
Mk Sharma
Shrishti Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
01564630
Message ID:
01564635
Vues:
50
This message has been marked as a message which has helped to the initial question of the thread.
>I want to print report in "8x6" paper, if i remove "Printer Envirinment" and select another printer with GetPrinter() then my report printed in "Letter" size on selected printer. ?

You build your report using any printer that supports format you wish to build. After you are done, you REMOVE printer info from
FRX report but PRESERVE page format so at run time VFP will print to whatever printer is default or one that you choose by issuing
cSelectedPrinter=GetPrinter()
set printer to name (cSelectedPrinter)
Here is function that you can use to clean FRX
function clean_frx
    lparameters cFrxFile
    local  cFrxFile,cRpNew,i
    local larray(1)
    if empty(cFrxFile)
        return .f.
    endif
    use (cFrxFile) in 0 alias FrxTable exclusive
    select FrxTable
    go top
    =alines(larray,FrxTable.expr)
    cRpNew=''
    for i=1 to alen(larray)
        if atc('ORIENTATION',larray(i)) > 0
            cRpNew=cRpNew+larray(i) + chr(13) + chr(10)
        endif
        if atc('PAPERSIZE',larray(i)) > 0
            cRpNew=cRpNew+larray(i)
        endif
    next
    replace FrxTable.expr with cRpNew
    replace FrxTable.tag  with ''
    replace FrxTable.tag2 with ''
    select FrxTable
    use
    wait window cFrxFile + chr(13) + '..... Cleared OK' nowait
    return .t.
You clean it up by calling function on any given frx;
cFrxFile=getfile('frx')  
=clean_frx(cFrxFile)
Normally I run this function in a loop on entire folder with frx files. Code that does this can be found in XDIR download here in downloads.

HTH
Sergio
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform