Page 1 of 1

Xbrowse or Report Bug

PostPosted: Mon Jan 15, 2018 4:28 pm
by Silvio.Falconi
I have this xbrowse


Image

and I made oBrowse:report()

Image

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:lFooter:=.t.
oBrowse:MakeTotals()

the xbrowse seems ok

Image

and I try to make a report

Image

but the report is bad


the importo is numeric field
{ "IMPORTO", "N", 9, 2 }

Re: Xbrowse or Report Bug

PostPosted: Mon Jan 15, 2018 9:14 pm
by James Bott
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

Re: Xbrowse or Report Bug

PostPosted: Tue Jan 16, 2018 11:24 am
by Silvio.Falconi
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

Re: Xbrowse or Report Bug

PostPosted: Tue Jan 16, 2018 1:37 pm
by nageswaragunupudi
Please replace this part of the code:
Code: Select all  Expand view
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: Select all  Expand view
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

Re: Xbrowse or Report Bug

PostPosted: Tue Jan 16, 2018 3:33 pm
by James Bott
Silvio,

there is a bug on harbour
not run round function


Can you give us an example?

James

Re: Xbrowse or Report Bug

PostPosted: Tue Jan 16, 2018 3:59 pm
by nageswaragunupudi
Mr James

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

Re: Xbrowse or Report Bug

PostPosted: Tue Jan 16, 2018 6:32 pm
by Silvio.Falconi
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

Re: Xbrowse or Report Bug

PostPosted: Tue Jan 16, 2018 10:17 pm
by nageswaragunupudi
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

Re: Xbrowse or Report Bug

PostPosted: Wed Jan 17, 2018 9:18 pm
by Silvio.Falconi
Now seem run ok
perhaps I found the error
oCol:lTotal := .t.
oCol:nTotal :=0

Re: Xbrowse or Report Bug

PostPosted: Wed Jan 17, 2018 11:27 pm
by nageswaragunupudi
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?

Re: Xbrowse or Report Bug

PostPosted: Thu Jan 18, 2018 10:53 am
by Silvio.Falconi
perhaps on win 10 because I try on win7 and run ok
I not Know How and why
but I published snapshot you saw