EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN

EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN

Postby juan fco. vasquez Mendoza » Wed Aug 21, 2013 9:21 pm

Hola, si alguien me puede facilitar un ejemplo de como crear una carta con el creador de reportes de FIVEWIN.

Gracias,
Juan Fco.
Rep. Dom.
juan fco. vasquez Mendoza
 
Posts: 84
Joined: Fri May 09, 2008 8:19 pm

Re: EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN

Postby Antonio Linares » Thu Aug 22, 2013 7:22 am

Juan,

En samples\report\rep20.prg tienes un ejemplo de como imprimir un campo memo en donde podrias tener almacenado el contenido de la carta :-)

rep20.prg
Code: Select all  Expand view
#include "FiveWin.ch"
#include "report.ch"


#define FWH905

STATIC oReport

Function Rep20()

     LOCAL nRecno, oFont


     if Select( "REPDEMO" ) > 0
      SELECT REPDEMO
     else
      USE REPDEMO
     endif

     DEFINE FONT oFont NAME "ARIAL" SIZE 0,-10

     nRecno := Recno()

     GO TOP

     REPORT oReport ;
          TITLE  "*** Fivewin Report ***"  ;
          FONT oFont ;
          PREVIEW

     COLUMN TITLE "Level" DATA Repdemo->Level SIZE 5
     COLUMN TITLE "Source" DATA Repdemo->Prg

#ifdef FWH905
     COLUMN TITLE "Comment" DATA Repdemo->Comments SIZE 50 MEMO
#else
     // This is required prior to FWH 905
     COLUMN TITLE "Comments" DATA " " SIZE 50     // * Trick *
#endif


     END REPORT

#ifdef FWH905
     ACTIVATE REPORT oReport
#else
     ACTIVATE REPORT oReport ON CHANGE SayMemo()
#endif

     GOTO nRecno
     oFont:End()

RETURN NIL

#ifndef FWH905

STATIC Function SayMemo()

     LOCAL cText, cLine
     LOCAL nFor, nLines

     cText := Repdemo->Comments

     nLines := MlCount(cText,50)

     oReport:BackLine(1)

     FOR nFor := 1 TO nLines

          //cLine := Alltrim(MemoLine(cText, 50, nFor))
          cLine := MemoLine(cText, 50, nFor)

          oReport:StartLine()
          oReport:Say(3,cLine)
          oReport:EndLine()

     NEXT

     oReport:Newline()

RETURN NIL

#endif

 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41898
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN

Postby Antonio Linares » Thu Aug 22, 2013 7:22 am

Juan,

En samples\report\rep20.prg tienes un ejemplo de como imprimir un campo memo en donde podrias tener almacenado el contenido de la carta :-)

rep20.prg
Code: Select all  Expand view
#include "FiveWin.ch"
#include "report.ch"


#define FWH905

STATIC oReport

Function Rep20()

     LOCAL nRecno, oFont


     if Select( "REPDEMO" ) > 0
      SELECT REPDEMO
     else
      USE REPDEMO
     endif

     DEFINE FONT oFont NAME "ARIAL" SIZE 0,-10

     nRecno := Recno()

     GO TOP

     REPORT oReport ;
          TITLE  "*** Fivewin Report ***"  ;
          FONT oFont ;
          PREVIEW

     COLUMN TITLE "Level" DATA Repdemo->Level SIZE 5
     COLUMN TITLE "Source" DATA Repdemo->Prg

#ifdef FWH905
     COLUMN TITLE "Comment" DATA Repdemo->Comments SIZE 50 MEMO
#else
     // This is required prior to FWH 905
     COLUMN TITLE "Comments" DATA " " SIZE 50     // * Trick *
#endif


     END REPORT

#ifdef FWH905
     ACTIVATE REPORT oReport
#else
     ACTIVATE REPORT oReport ON CHANGE SayMemo()
#endif

     GOTO nRecno
     oFont:End()

RETURN NIL

#ifndef FWH905

STATIC Function SayMemo()

     LOCAL cText, cLine
     LOCAL nFor, nLines

     cText := Repdemo->Comments

     nLines := MlCount(cText,50)

     oReport:BackLine(1)

     FOR nFor := 1 TO nLines

          //cLine := Alltrim(MemoLine(cText, 50, nFor))
          cLine := MemoLine(cText, 50, nFor)

          oReport:StartLine()
          oReport:Say(3,cLine)
          oReport:EndLine()

     NEXT

     oReport:Newline()

RETURN NIL

#endif

 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41898
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN

Postby juan fco. vasquez Mendoza » Thu Aug 22, 2013 9:02 pm

Gracias Maestro,
Abrazos
juan fco. vasquez Mendoza
 
Posts: 84
Joined: Fri May 09, 2008 8:19 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 34 guests