Page 1 of 1

choose printer

Posted: Mon Jul 31, 2006 2:10 pm
by clemerson
Hi,

Does option exist in the fwh to choose the printer that wants to print?

Clemerson

Re: choose printer

Posted: Mon Jul 31, 2006 2:57 pm
by Enrico Maria Giordano
Yes, use the TO clause of the PRINT command.

EMG

Posted: Mon Jul 31, 2006 7:52 pm
by clemerson
EnricoMaria,

like this me yours to do. I wanted to do before the report the user to choose the printer that wants to print:

Image


Clemerson

Posted: Mon Jul 31, 2006 7:55 pm
by Antonio Linares
Clemerson,

PRINTER oPrn ... FROM USER

Posted: Mon Jul 31, 2006 8:16 pm
by clemerson
Antonio,

here he gave right:
PRINT oPrn FROM USER NAME "Relatório Fechamento..." Preview

and in this example where would put FROM USER?

REPORT oRpt CAPTION "Clientes" TITLE "Cadastro de Clientes" ;
HEADER "Data: " + DToC( Date() ) + ", Hora: " + Time() ;
FOOTER "Página: " + Str( oRpt:nPage, 3 ) ;
PREVIEW
COLUMN TITLE "Código" DATA clientes->Codigo," "," "
COLUMN TITLE "Nome","Endereco","Telefone" DATA clientes->Nome,clientes->Endereco,clientes->telefone
COLUMN TITLE "Cidade","Bairro","Estado" DATA clientes->Cidade,clientes->Bairro,clientes->Estado
END REPORT
ACTIVATE REPORT oRpt FOR SUBST(Clientes->Nome,1,1)>=De .AND. SUBST(Clientes->Nome,1,1)<=Ate .AND. EMPTY(clientes->Convenio)

Clemerson

Posted: Mon Jul 31, 2006 8:22 pm
by Enrico Maria Giordano
PRINT oPrn ... FROM USER

REPORT oRpt ... TO DEVICE oPrn

EMG

Posted: Mon Jul 31, 2006 8:34 pm
by clemerson
EnricoMaria wrote:PRINT oPrn ... FROM USER

REPORT oRpt ... TO DEVICE oPrn

EMG
he didn't work:

REPORT oRpt CAPTION "Clientes" TITLE "Cadastro de Clientes" ;
HEADER "Data: " + DToC( Date() ) + ", Hora: " + Time() ;
FOOTER "Página: " + Str( oRpt:nPage, 3 ) ;
TO DEVICE oRpt ;
PREVIEW
.
.
.

Clemerson

Posted: Tue Aug 01, 2006 4:22 am
by areang
try this :shock:

REPORT oRpt CAPTION "Clientes" TITLE "Cadastro de Clientes" ;
HEADER "Data: " + DToC( Date() ) + ", Hora: " + Time() ;
FOOTER "Página: " + Str( oRpt:nPage, 3 ) ;
FROM USER ;
PREVIEW

Best Regard
Areang

Posted: Tue Aug 01, 2006 7:06 am
by Enrico Maria Giordano
This is a working sample:

Code: Select all

#include "Fivewin.ch"
#include "Report.ch"


FUNCTION MAIN()

    LOCAL oPrn, oRpt

    USE TEST

    PRINT oPrn FROM USER PREVIEW

    REPORT oRpt TO DEVICE oPrn

    COLUMN TITLE "LAST";
           DATA FIELD -> last

    COLUMN TITLE "FIRST";
           DATA FIELD -> first

    END REPORT

    ACTIVATE REPORT oRpt

    CLOSE

    RETURN NIL
EMG