Set User Sequence / Set User Selection

BBritain

VIP Member
Forum,

Does anyone know if ‘Set User Selection’ functions need to be processed before or after ‘Set User Sequence’ functions?

I have a UBE which is using both Set User Selection AND Set User Sequence commands quite extensively. The UBE has a default sequence of Item1, Item2, Item3 AND has Level Break Headers (LBFs) and Level Break Footers (LBFs) for all three fields. I currently use Processing Options to change the data sequence as well as control the display of the LBFs and LBHs (via Suppress Writes).

Under certain conditions I need to sequence by Item2, Item1, Item3. Unfortunately, my level breaks for Item2 trigger everytime Item1 hits a level break. I understand the logic for Item2 level breaks to trigger everytime Item1 breaks – when the default sequence is in effect. Is there anyway to get around this?

Item1 Item2 Item3 (default sort order)
A 11 A01
A 12 J23
B 08 M35
B 11 A01
B 15 Q35
C 12 J23

Item2 Item1 Item3 (alternate sort order)
08 B M35
11 A A01
11 B A01
12 A J23
12 C J23
15 B Q35
It would be nice if Item2 level breaks didn’t trigger on every record. Can anyone help?

Ben again,
E9, AS400, DB2/400
 
Hi!
This is a strange issue... Sometime (I remember it from B733.1) this solution worked fine: Level break was only triggered according to the change of trigger field and using programmed sequence it worked fine.
Unfortunately level break is "understood" now a break on the field and all above... so anyway you sort by programme the level break will always display if the trigger field or any of the above fields in the original sequencing change...
I think the best solution is programmed level break where the conditions include your parameters for sequencing...
I hope this helps.
Regards:
Gergely Pongrácz
e-Best, Hungary
 
Gergely,

Have you done this custom breaking before? If you have, can you give me a head start on accomplishing it? In my circumstances, the program actually has four each of LBHeaders and LBFooters. Would I need to make them all custom or can automatic and custom level breaks 'co-exist'?

Also, I am not sure which events would be appropriate/best for the custom triggering.

Ben again,
 
Set User Sequence is processed first and then selection.

Are you putting the sequencing in the Initialize section of the report section? Or, are you sequencing with the help of RDA?

Also, remember that level break footers, will print the next value in the recordset, unless the original value has been stored in an event rule variable, and then passed to a Report Variable on the break section.

Can you send me a screen shot of your UBE?
 
Hi Ben,
Yes, of course, I have done it many times...
Here is an example code for two fields:
Main Section, Init Section:
If PO1=1
Set User Sequence(A)
Set User Sequence(B)
else
Set User Sequence(B)
Set User Sequence(A)
endif
VA rpt_cFirstLineFlag=1

Main Section, Do Section:
Header Display fields=BC fields
If FirstLineFlag=1
if PO1=1
Do Custom Section(HeaderA)
Do Custom Section(HeaderB)
else
Do Custom Section(HeaderB)
Do Custom Section(HeaderA)
endif
else
if PO1=1
if VA PrevA!=BC A
Do Custom Section(FooterB)
Do Custom Section(FooterA)
Do Custom Section(HeaderA)
Do Custom Section(HeaderB)
else
if VA PrevB!=BC B
Do Custom Section(FooterB)
Do Custom Section(HeaderB)
endif
endif
else
if VA PrevB!=BC B
Do Custom Section(FooterA)
Do Custom Section(FooterB)
Do Custom Section(HeaderB)
Do Custom Section(HeaderA)
else
if VA PrevA!=BC A
Do Custom Section(FooterA)
Do Custom Section(HeaderA)
endif
endif
endif
endif
FirstLineFlag=0
Footer cumulative fields=Footer cum fields+BC fields
VA PrevA=BC A
VA PrevB=BC B

Main Section, End Section
If FirstLineFlag!=1
If PO1=1
Do Custom Section(HeaderB)
Do Custom Section(HeaderA)
else
Do Custom Section(HeaderA)
Do Custom Section(HeaderB)
endif
endif

All Footer Section should set their cumulative values to 0 in After Last Object Printed event.
Hope I remembered everything and I was able to help you!
Regards:
Gergely Pongrácz
e-Best, Hungary
 
Back
Top