Report Class question

Report Class question

Postby Silvio.Falconi » Sat May 09, 2020 4:52 pm

I have two arrays and I print directly with the oReport class, but one array at a time on two different pages.
Is it possible to print the two reports on the same page?

Image Image

I can't put everything in an array also because then the columns are different (also the titles of the columns)

some idea ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm

Re: Report Class question

Postby nageswaragunupudi » Sat May 09, 2020 8:41 pm

As of now, we can not print two reports on a single page.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10295
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Report Class question

Postby ADutheil » Sun May 10, 2020 2:49 pm

nageswaragunupudi wrote:As of now, we can not print two reports on a single page.


I did it more than 20 years ago using FW 16 bits. I remember it was a bit tricky, using the DelColumn and AddColumn methods with bPostEnd block but it worked flawlessly. For a reason I could not discover the upgrade to FWH broke my code. As it coincided with the closing of the company I was working I did not dig it anymore. Here is the interesting part of the code:
Code: Select all  Expand view


...................
      REPORT oReport ;
         CAPTION "BOLETIM DIÁRIO DE BANCO" ;
         TITLE  "BOLETIM DIÁRIO DE BANCO"  ;
         HEADER fantasia + xPadL( space( 30 ), 700 ) + "Nº" + allTrim( cNumbol ) + if( nLetra > 64, "-" + chr( nLetra ), "" ), razao + xPadL( space( 30 ), 600 ) + dToC( dDatc );
         FONT oFont, oFon2 PREVIEW
         COLUMN TITLE "Doc."      DATA temp->DOC LEFT  GRID
         COLUMN TITLE "Histórico" DATA " "       SIZE 50 GRID
         COLUMN TITLE "Banco"     DATA " "       CENTER  GRID
         COLUMN TITLE "Cheque"    DATA " "       CENTER  GRID
         COLUMN TITLE "Entrada"   DATA "          " RIGHT GRID
         COLUMN TITLE "Saída"     DATA "          " RIGHT GRID
      END REPORT
      IF oReport:lCreated
        nMarg := oReport:Margin
         oReport:bStdFont := { || 1 }
         oReport:bStartRecord  := { || ChkNewPg(), SayTran() }
         oReport:bPostEnd  := { || SayTotal( dDatc, nMarg ) }
         oReport:oTitle:aFont[ 1 ] := {|| 2 }
         oReport:oHeader:aFont[ 1 ] := { || 2 }
      ENDIF
      ACTIVATE REPORT oReport ON CHANGE SayMemo( @aSubt )
.................

STATIC FUNCTION SayMemo
local cText  := allTrim( temp->HIS )
local cLine  := ""
local nFor   := 1
local nLines := MlCount(cText,50)

oReport:BackLine( 1 )
FOR nFor := 1 TO nLines
    cLine := MemoLine(cText, 50, nFor)
    oReport:StartLine()
    oReport:Say(2,cLine)
    if nFor = nLines
       oReport:Say( 3, temp->BCO, 1, RPT_CENTER )
       oReport:Say( 4, temp->CHQ, 1, RPT_CENTER )
       oReport:Say( 5, Virg( temp->ENT, 12 ), 1, RPT_RIGHT )
       oReport:Say( 6, Virg( temp->SAI, 12 ), 1, RPT_RIGHT )
    endif
    oReport:EndLine()
NEXT
aSubt[ 1 ] += temp->ENT
aSubt[ 2 ] += temp->SAI
oReport:Newline()
RETURN NIL

STATIC PROCEDURE SaySubt
if temp->( !eOF() )
   oReport:BackLine( 1 )
   oReport:grid()
   oReport:Say( 2, " A  T R A N S P O R T A R", 2 )
   oReport:Say( 5, Virg( aSubt[ 1 ], 12 ), 2, RPT_RIGHT )
   oReport:Say( 6, Virg( aSubt[ 2 ], 12 ), 2, RPT_RIGHT )
   lTran := .t.
endif
return

STATIC PROCEDURE SayTran
if lTran .and. nLetra > 64
   oReport:newLine()
   oReport:Say( 2, "T R A N S P O R T E", 2 )
   oReport:Say( 5, Virg( aSubt[ 1 ], 12 ), 2, RPT_RIGHT )
   oReport:Say( 6, Virg( aSubt[ 2 ], 12 ), 2, RPT_RIGHT )
   oReport:endLine()
   oReport:newLine()
   lTran := .f.
endif
return

STATIC FUNCTION ChkNewPg()
if oReport:nRow + ( ( MlCount( allTrim( temp->HIS ), 50 ) + 1 ) * oReport:nStdLineHeight ) >= ( oReport:nBottomRow - oReport:nStdLineHeight )
   SaySubt()
   oReport:nRow := oReport:nBottomRow
   nLetra ++
endif
return ( NIL )

STATIC PROCEDURE SayTotal( dDatc, nMarg )
oReport:Separator( , oReport:nRow )
oReport:grid()
oReport:Say( 2, "T O T A L", 2 )
oReport:Say( 5, Virg( aSubt[ 1 ], 12 ), 2, RPT_RIGHT )
oReport:Say( 6, Virg( aSubt[ 2 ], 12 ), 2, RPT_RIGHT )
oReport:endLine()
oReport:Separator( , oReport:nRow )
SaySaldos( dDatc )
return

STATIC PROCEDURE SaySaldos( dDatc, nMarg )
local nTot_ant := 0
local nTot_nov := 0
local nI       := 1
local nBanc    := 0
local oColumn  := NIL
local aTota    := { 0, 0, 0, 0 }
local lNpag    := .f.
local nPosi    := 0
bancos->( ordSetFocus( 0 ), dbGoTop(), dbEval( { || nBanc += if( bancos->abertura <= dDatc .and. ( empty( bancos->FECHADA ) .or. bancos->FECHADA >= dDatc ), 1, 0 ) } ) )
if oReport:nRow >= ( oReport:nBottomRow - ( ( nBanc + 6 ) * oReport:nStdLineHeight ) )
   oReport:Say( 2, "FECHAMENTO NA PROXIMA FOLHA", 2 )
   oReport:EndPage()
   lNpag := .t.
   nLetra ++
endif
nPosi := ( oReport:nRow + oReport:nStdLineHeight )
oReport:DelColumn( 6 )
oReport:DelColumn( 5 )
oReport:DelColumn( 4 )
oReport:DelColumn( 3 )
oReport:DelColumn( 2 )
oReport:DelColumn( 1 )
dbSelectArea( "bancos")
bancos->( ordSetFocus( 2 ), dbgotop() )
oColumn := TRColumn():New( {{|| "BANCO"}}, , {{|| bancos->NOME }}, 30, {} ,, .F., ,UPPER("LEFT"), .F., .T.,, oReport )
oReport:AddColumn( oColumn )
oColumn := TRColumn():New( {{|| "SALDO ANTERIOR"}}, , {{|| "              " }},, {} ,, .F., ,UPPER("LEFT"), .F., .T.,, oReport )
oReport:AddColumn( oColumn )
oColumn := TRColumn():New( {{|| "       ENTRADA"}}, , {{|| "              " }},, {} ,, .F., ,UPPER("LEFT"), .F., .T.,, oReport )
oReport:AddColumn( oColumn )
oColumn := TRColumn():New( {{|| "         SAÍDA"}}, , {{|| "              " }},, {} ,, .F., ,UPPER("LEFT"), .F., .T.,, oReport )
oReport:AddColumn( oColumn )
oColumn := TRColumn():New( {{|| "   SALDO ATUAL"}}, , {{|| "              " }},, {} ,, .F., ,UPPER("LEFT"), .F., .T.,, oReport )
oReport:AddColumn( oColumn )
oReport:Margin( nMarg, 1 )
//oReport:Margin( 5, 1, 2 )
oReport:Stabilize()
if lNpag
   oReport:StartPage()
else
   oReport:nTitleRow := nPosi
   oReport:ColTitle()
endif
while bancos->( !eOF() )
   if bancos->abertura <= dDatc .and. ( empty( bancos->FECHADA ) .or. bancos->FECHADA >= dDatc )
      oReport:NewLine()
      oReport:grid()
      oReport:Say( 1, bancos->NOME, 1 )
      oReport:Say( 2, Virg( saldo( bancos->CODI, 2 ),12 ), 1, RPT_RIGHT )
      oReport:Say( 3, Virg( saldo( bancos->CODI, 3 ),12 ), 1, RPT_RIGHT )
      oReport:Say( 4, Virg( saldo( bancos->CODI, 4 ),12 ), 1, RPT_RIGHT )
      oReport:Say( 5, Virg( saldo( bancos->CODI, 5 ),12 ), 1, RPT_RIGHT )
      oReport:EndLine()
      aTota[ 1 ] += saldo( bancos->CODI, 2 )
      aTota[ 2 ] += saldo( bancos->CODI, 3 )
      aTota[ 3 ] += saldo( bancos->CODI, 4 )
      aTota[ 4 ] += saldo( bancos->CODI, 5 )
   endif
   bancos->( dbSkip() )
enddo
oReport:TotalLine( RPT_SINGLELINE, 2 )
oReport:grid()
oReport:Say( 1, "TOTAIS", 2 )
oReport:Say( 2, Virg( aTota[ 1 ],12 ), 2, RPT_RIGHT )
oReport:Say( 3, Virg( aTota[ 2 ],12 ), 2, RPT_RIGHT )
oReport:Say( 4, Virg( aTota[ 3 ],12 ), 2, RPT_RIGHT )
oReport:Say( 5, Virg( aTota[ 4 ],12 ), 2, RPT_RIGHT )
oReport:EndLine()
oReport:TotalLine( RPT_SINGLELINE, 0 )
oReport:End()
return


 
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Report Class question

Postby Otto » Mon May 11, 2020 7:17 am

Hello André,
Thank you for remembering this.
I once worked on a converter from oReport to VRD files for EasyReport.
I will search for it. There is no quicker way to define reports for easy easy once and lists as oReport.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6046
Joined: Fri Oct 07, 2005 7:07 pm

Re: Report Class question

Postby Silvio.Falconi » Mon May 11, 2020 7:51 am

Otto wrote:Hello André,
Thank you for remembering this.
I once worked on a converter from oReport to VRD files for EasyReport.
I will search for it. There is no quicker way to define reports for easy easy once and lists as oReport.
Best regards
Otto

otto I prefer work with myRptv than ER because you not understood Also new ER not run ok than oldest ER

Se of the Also have not a reportdesigner good
I Asl It from 15 years ago
Do you saw the reportdesigner of -?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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