Alternating Ascending / Decending Sort on Report Detail

BrynJ

New member
Local time
Today, 16:00
Joined
Feb 10, 2004
Messages
8
I have a fairly obscure requirement - what I have is a report with a header and a subsequent detail section. At the moment the header and detail sections are sorted in ascending order. What I need to be able to do is alternatively sort the the detail section in ascending then decending order. Hope that makes sense, if not maybe I can illustrate it better:

Code:
HEADER1
    A1
    A1
    A2
    A2
HEADER2
    A2
    A2
    A1
    A1
HEADER3
    A1
    A1
    A2
    A2
etc.

The report is the basis of a production batch list, where orders are sequenced on a customer by customer basis (the header section). The detail section represents the different products being manufactured (configured into despatch loads) and the order of manufacture. It is more efficient to manufacture products of the same type in groups, hence why I need to introduce the false grouping by way of the alternating ascending / decending sort order.

So, is this possible or am I tackling the problem in the wrong way? All help and suggestions are appreciated.

Thanks,

Bryn
 
I thought I would give an update to my question - I came up with a solution that works, although it ain't too pretty and I'd be interested in hearing of alternative solutions.

The headers in my report are based on a build sequence number, so what I did was split the report query in two - using the mod function to return all the odd number sequences in one query and the even number ones in the other query. In the odd query I created an additional field which was the sequence number plus one - a way for me to link back to the even query.

The main report I based around the odd query, then I put the even query as a subreport into the detail section, linking the field I created (odd sequence number plus 1) to the even sequence number in the subreport. I use ascending sort in the detail section of the main report and descending sort in the subreport - hey presto, I get what I wanted :)

Like I said though, this solution isn't the most elegant - so, is there another way?
 

Users who are viewing this thread

Back
Top Bottom