Page 1 of 1

Group on Report ( from xbrowse)

Posted: Fri May 05, 2023 9:15 am
by Silvio.Falconi
I have a field as oDbf:prov

on Report if I made

Code: Select all | Expand

 AAdd(oRep:aGroups,trGroup():New({||oDbf:prov},{||""},{||"Total"},{|| 1 },.t.,oRep))
run ok


but I not Know the field because the final user select the field

So, I calculate from xbrowse the indices and the fields

Code: Select all | Expand

  
local aGroup := {}
local aFields := {}

AEval(  oBrw:aCols, { |o| If( o:lHide .or. Empty( o:cSortOrder ),, AAdd( aGroup, o:cCbxItem ) ) } )
AEval(  oBrw:aCols, { |o| If( o:lHide .or. Empty( o:cSortOrder ),, AAdd( afields, o:cExpr ) ) } )

 
then the final use select from a combobox the fields want make the group on report


then I make

Code: Select all | Expand

 AAdd(oRep:aGroups,trGroup():New({||"oDbf:"+(afields[nGroup])},{||""},{||"Total"},{|| 1 },.t.,oRep))

 
but not run ...why ?

Re: Group on Report ( from xbrowse)

Posted: Fri May 05, 2023 10:01 am
by Antonio Linares
Dear Silvio,

> AAdd(oRep:aGroups,trGroup():New({||"oDbf:"+(afields[nGroup])},{||""},{||"Total"},{|| 1 },.t.,oRep))

AAdd(oRep:aGroups,trGroup():New( &( "{||oDbf:" + (afields[nGroup])}" ),{||""},{||"Total"},{|| 1 },.t.,oRep))

Re: Group on Report ( from xbrowse)

Posted: Fri May 05, 2023 12:01 pm
by Silvio.Falconi
Antonio Linares wrote:Dear Silvio,

> AAdd(oRep:aGroups,trGroup():New({||"oDbf:"+(afields[nGroup])},{||""},{||"Total"},{|| 1 },.t.,oRep))

AAdd(oRep:aGroups,trGroup():New( &( "{||oDbf:" + (afields[nGroup])}" ),{||""},{||"Total"},{|| 1 },.t.,oRep))


source\ut\ut_prn.prg(373) Error E0002 Unterminated string '},{|| 1 },.t.,oRep))'
source\ut\ut_prn.prg(373) Error E0030 Syntax error "syntax error at '}'"


then

Error occurred at: 05-05-2023, 14:03:27
Error description: Error BASE/1449 Syntax error: &
Args:
[ 1] = C {||oDbf: + (afields[nGroup])}

Stack Calls
===========
Called from: source\ut\ut_prn.prg => MYSETUP( 373 )

Re: Group on Report ( from xbrowse)

Posted: Fri May 05, 2023 12:34 pm
by Silvio.Falconi
Resolved with fieldWBlock

Re: Group on Report ( from xbrowse)

Posted: Fri May 05, 2023 1:29 pm
by Silvio.Falconi
I have also these problems

Image

I cannot print the total of Pages type xx/xx
I wish a newline after "Provincia: AG" on top
I wish a newline on footer " Totale...."
I wish the effect pijama