FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN
Posts: 102
Joined: Fri May 09, 2008 08:19 PM
EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN
Posted: Wed Aug 21, 2013 09: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.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN
Posted: Thu Aug 22, 2013 07: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 (fw): Select all Collapse
#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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN
Posted: Thu Aug 22, 2013 07: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 (fw): Select all Collapse
#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
Posts: 102
Joined: Fri May 09, 2008 08:19 PM
Re: EJEMPLO PARA CREAR UNA CARTA CON CREADOR DE REPORTES FIVEWIN
Posted: Thu Aug 22, 2013 09:02 PM

Gracias Maestro,
Abrazos

Continue the discussion