>>>Dear all,
>>>I have a table with some records such as below :
>>>
>>>RecType-Step-Fee
>>>1-1-100
>>>1-1-200
>>>1-2-400
>>>2-1-300
>>>2-2-500
>>>
>>>I want to show these recordes in a report as below :
>>>
>>>RecType:1 and Step:1
>>>-----------
>>>1-1-100
>>>1-1-200
>>>-----------
>>>Sum : 300
>>>
>>>RecType:1 and step:2
>>>-----------
>>>1-2-400
>>>-----------
>>>Sum : 400
>>>
>>>RecType:2 and Step:1
>>>-----------
>>>2-1-300
>>>-----------
>>>Sum : 300
>>>
>>>RecType:2 and Step:2
>>>-----------
>>>2-2-500
>>>-----------
>>>Sum : 500
>>>
>>>
>>>
>>>I put RecType in DataGrouping, Group expression but i don't know how add Step to it.
>>>Can i do this?
>>>Thanks
>>
>>
>>Hi Reza
>>
>>By preproccessing report cursor, you can create some fake composite field to group records more easy;
>>
>>1-1
>>1-2
>>2-1
>>2-2
>>
>>values can be turned to fixed lenght character expressions like
>>
>>001001
>>001002
>>002001
>>002001
>>(see padl())
>>
>>Then grouping is easy. If you called this fake hierarchical field 'hkey'
>>
>>First level of grouping (group expression) can be
>>left(hkey,3)
>>Second level
>>left(hkey,6)
>>
>>And so for as many level of grouping you need.
>>
>>
>>HTH
>>Sergio
>
>
>Thanks
>can you explane below section more?
>
>First level of grouping (group expression) can be
>left(hkey,3)
>Second level
>left(hkey,6)
>
>I don't understand First and second level?
Sorry Reza I did not explained it better;
What I meant is after you convert hierarchy keys you have now
1-1
1-2
2-1
2-3
etc
Into fake keys 001-001,001-002 etc (but without dash)
provided that cursor is ordered by this composite key, these would have been exactly group expressions
for your FRX.
First group (expression)
left(hkey,3)
then
left(hkey,6)
And so for.
'Hkey' here is just a field name I assigned to this artificial field which is to be used to order cursor and
build FRX grouping easily.
You might need just one level of grouping, whereas this is general way to implement this kind of
hierarchies for reporting purposes.
HTH
Sergio