Page 1 of 1

Crash after oBrw:Report()

Posted: Tue May 27, 2008 8:59 am
by HunterEC
Hi guys: :)
After doing a oBrw:Report() I tried to Create a report and the program crashes. What's wrong in this piece of code ?

Code:

FUNCTION Main()
LOCAL oDlg, oBrw, oReport, oFont1, oFont2, cTimeStamp

SET CENTURY ON

USE Test NEW

SET INDEX TO Test

DEFINE DIALOG oDlg;
SIZE 800, 600

@ 0, 0 LISTBOX oBrw FIELDS

oBrw:bLine := &( "{ || { Name, Lastname } }" )

ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER

oBrw:Report()

GO TOP

DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10
DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD

cTimeStamp := "Fecha: " + DTOC(DATE()) + " Hora: " + TIME()

REPORT oReport TITLE "*** My First Report ***" ;
CAPTION "Reporte De Cuentas A Cobrar" ;
HEADER cTimeStamp ;
FONT oFont1, oFont2 ;
FOOTER "Pagina: " + LTRIM(STR(oReport:nPage,5)) CENTER ;
PREVIEW

COLUMN TITLE "First Name" DATA Test->Name
COLUMN TITLE "Last Name" DATA Test->Lastname
COLUMN TITLE "Balance Due", "Ultimo Pago" DATA Test->Balance, Test->Lastpmt ;
PICTURE "$99,999.99", "D" TOTAL RIGHT SHADOW

GROUP ON Test->Pat_city ;
FOOTER "Ciudad:" + TRIM(oReport:aGroups[1]:cValue) + ;
STR(oReport:aGroups[1]:nCounter,4) ;
FONT 2
GROUP ON Test->Pat_lastn ;
FOOTER " Total Para Cliente " + TRIM(oReport:aGroups[2]:cValue) + ": " + ;
STR(oReport:aGroups[2]:nCounter,4) ;
FONT 2

END REPORT

oReport:lsummary := .T.
oReport:aGroups[2]:bFootFont := {|| 2}

ACTIVATE REPORT oReport ON STARTGROUP JumpLines(@oReport, 2)

oFont1:End()
oFont2:End()

CLOSE ALL
RETURN NIL


Error Message:

Error description: Error BASE/1132 Bound error: array access

Called from: => LOCKERRHAN(0)
Called from: => (b)INITHANDL$(0)
Called from: => TPREVIEW:BUILDWINDO(0)
Called from: => TPREVIEW:NEW(0)
Called from: => RPREVIEW(0)
Called from: => (b)NEW(0)
Called from: => TREPORT:ACTIVATE(0)
Called from: => MAIN(69)

Posted: Tue May 27, 2008 10:19 am
by Antonio Linares
Gustavo,

What FiveWin for Clipper version are you using ?

Posted: Wed May 28, 2008 12:59 am
by HunterEC
Ver. 8.03

Posted: Wed May 28, 2008 8:02 am
by Antonio Linares
Gustavo,

Whats the source code for function JumpLines() ?

Here your PRG is working fine without that function.

Posted: Wed May 28, 2008 8:24 am
by HunterEC
Antonio: source code for JumpLines()


STATIC PROCEDURE JumpLines (oReport, nLines)
LOCAL nI

FOR nI := 1 TO nLines
oReport:NewLine()
NEXT
RETURN

Posted: Thu May 29, 2008 9:20 am
by Antonio Linares
Your code is working fine here using FWH 32 bits.

We strongly recommend you to port your application to 32 bits. It will save you from many troubles.

Posted: Fri May 30, 2008 9:03 am
by HunterEC
Thank you.