FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse or Report Bug
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Xbrowse or Report Bug
Posted: Mon Jan 15, 2018 04:28 PM
I have this xbrowse




and I made oBrowse:report()



I made
@ 0, 05 XBROWSE oBrowse OF oDlg ;
SIZE 315,200 PIXEL ;
CURSOR oCursorBtn NOBORDER


oBrowse:cAlias := "MV"


oCol := oBrowse:AddCol()
oCol:bStrData := { || Cf(MV->data) }
oCol:cHeader := i18n( "Data" )
oCol:nWidth := 80

oCol := oBrowse:AddCol()
oCol:bStrData := { || MV->attivita }
oCol:cHeader := i18n( "Attività" )
oCol:nWidth := 200

oCol := oBrowse:AddCol()
oCol:bStrData := { || MV->causale }
oCol:cHeader := i18n( "Causale" )
oCol:nWidth := 200

oCol := oBrowse:AddCol()
oCol:bStrData := { || round(MV->importo,2) }
oCol:cHeader := i18n( "Importo Totale" )
oCol:nWidth := 150
oCol:nDataStrAlign := AL_RIGHT
oCol:cEditPicture := PictEuros()
oCol:lTotal := .t.
oCol:nTotal :=0
oCol:nFooterType := AGGR_SUM
oCol:nFootStrAlign := AL_RIGHT


FUNCTION PictEuros()
RETURN( "@E 9,999,999,999.99" )




Another test
I change on this type

oCol := oBrowse:AddCol()
oCol:bStrData := { || Cf(MV->data) }
oCol:cHeader := i18n( "Data" )
oCol:nWidth := 80

oCol := oBrowse:AddCol()
oCol:bStrData := { || MV->attivita }
oCol:cHeader := i18n( "Attività" )
oCol:nWidth := 200

oCol := oBrowse:AddCol()
oCol:bStrData := { || MV->causale }
oCol:cHeader := i18n( "Causale" )
oCol:nWidth := 200

oCol := oBrowse:AddCol()
oCol:bStrData := { || MV->importo}
oCol:cHeader := i18n( "Importo Totale" )
oCol:nWidth := 150

oBrowse:lHScroll := .f.
oBrowse:SetRDD()
oBrowse:CreateFromCode()
oBrowse:=.t.
oBrowse:MakeTotals()

the xbrowse seems ok



and I try to make a report



but the report is bad


the importo is numeric field
{ "IMPORTO", "N", 9, 2 }
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Xbrowse or Report Bug
Posted: Mon Jan 15, 2018 09:14 PM

Silvio,

This looks like some kind of math bug in Harbour/xHarbour that we just found in you other problem.

I workaround might be to convert all the numbers to text when importing them to the xBrowse and also right justify the column.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Xbrowse or Report Bug
Posted: Tue Jan 16, 2018 11:24 AM
there is a bug on harbour
not run round function
but now I tried with
#xtranslate round(<nVal>,<nDec>) => val(str(<nVal>,20,<nDec>))
and run ok

converting my applications to Harbor made me waste only a lot of precious time
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse or Report Bug
Posted: Tue Jan 16, 2018 01:37 PM
Please replace this part of the code:
Code (fw): Select all Collapse
oCol := oBrowse:AddCol()
oCol:bStrData := { || round(MV->importo,2) }
oCol:cHeader := i18n( "Importo Totale" )
oCol:nWidth := 150
oCol:nDataStrAlign := AL_RIGHT
oCol:cEditPicture := PictEuros()
oCol:lTotal := .t.
oCol:nTotal :=0
oCol:nFooterType := AGGR_SUM
oCol:nFootStrAlign := AL_RIGHT


with
Code (fw): Select all Collapse
oCol := oBrowse:AddCol()
oCol:bEditValue := { || round(MV->importo,2) }
oCol:cHeader := i18n( "Importo Totale" )
oCol:nWidth := 150
oCol:nDataStrAlign := AL_RIGHT
oCol:cEditPicture := PictEuros()
oCol:nFooterType := AGGR_SUM
oCol:nFootStrAlign := AL_RIGHT


Please also remove the #xtranslate for round.
Please use Harbour's built in Round()

=======
OR
=======
You send me the DBF
Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Xbrowse or Report Bug
Posted: Tue Jan 16, 2018 03:33 PM
Silvio,

there is a bug on harbour
not run round function


Can you give us an example?

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse or Report Bug
Posted: Tue Jan 16, 2018 03:59 PM

Mr James

There is no bug in Harbour.
It is all in the way you write the browse code.

Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Xbrowse or Report Bug
Posted: Tue Jan 16, 2018 06:32 PM

Rao,
I tried as you sad but it make error here
when I insert #translate string run perfectly
As you told me I can send you a test

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse or Report Bug
Posted: Tue Jan 16, 2018 10:17 PM
Silvio.Falconi wrote:Rao,
I tried as you sad but it make error here
when I insert #translate string run perfectly
As you told me I can send you a test

Please just send me the DBF
Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Xbrowse or Report Bug
Posted: Wed Jan 17, 2018 09:18 PM

Now seem run ok
perhaps I found the error
oCol:lTotal := .t.
oCol:nTotal :=0

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse or Report Bug
Posted: Wed Jan 17, 2018 11:27 PM
Silvio.Falconi wrote:Now seem run ok
perhaps I found the error
oCol:lTotal := .t.
oCol:nTotal :=0


Do you now mean, there is no bug in xbrowse or report or round function of Harbour?
Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Xbrowse or Report Bug
Posted: Thu Jan 18, 2018 10:53 AM

perhaps on win 10 because I try on win7 and run ok
I not Know How and why
but I published snapshot you saw

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion