FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour choose printer
Posts: 58
Joined: Fri Mar 10, 2006 08:13 PM
choose printer
Posted: Mon Jul 31, 2006 02:10 PM

Hi,

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

Clemerson

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: choose printer
Posted: Mon Jul 31, 2006 02:57 PM

Yes, use the TO clause of the PRINT command.

EMG

Posts: 58
Joined: Fri Mar 10, 2006 08:13 PM
choose printer
Posted: Mon Jul 31, 2006 07:52 PM
EnricoMaria,

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




Clemerson
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
choose printer
Posted: Mon Jul 31, 2006 07:55 PM

Clemerson,

PRINTER oPrn ... FROM USER

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 58
Joined: Fri Mar 10, 2006 08:13 PM
choose printer
Posted: Mon Jul 31, 2006 08:16 PM

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

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
choose printer
Posted: Mon Jul 31, 2006 08:22 PM

PRINT oPrn ... FROM USER

REPORT oRpt ... TO DEVICE oPrn

EMG

Posts: 58
Joined: Fri Mar 10, 2006 08:13 PM
choose printer
Posted: Mon Jul 31, 2006 08:34 PM
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
Posts: 128
Joined: Mon Jul 31, 2006 03:23 PM
choose printer
Posted: Tue Aug 01, 2006 04:22 AM

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

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
choose printer
Posted: Tue Aug 01, 2006 07:06 AM
This is a working sample:

#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

Continue the discussion