CR.NET / VB.NET / SQL Server
I have a joined table of product information supplied by a stored procedure, relevant fields being OrderID and ProductID. I have a group for each OrderID so the header info for each order gets displayed on each page with all the items with that OrderID displayed in the details section. This is the packing slip that goes with each order when shipped to the customer.
The bulk of the orders only have one item in them, so the production department needs to have these orders sorted by ProductID so when they package, they can go through X orders in a row that all have the same product.
When I group by OrderID maintaining the original sorted order (product count per order then ProductID), if the items returned are not sequential (ProductID's of 2 and 6 on one order and 4 and 7 on another), all each order's items don't get put in the same group. If I set the group to sort ascending, then the single item orders are no longer grouped (well, sorted) by ProductID. I tried to group in specified order, but the only field I can use as a conditional is the one I'm grouping by, which is not the group I want to sort by.
Am I making any sense? This is very frustrating because is seems so simple in my head but I can't find a way to do it.
________________________________________
Andrew
I have a joined table of product information supplied by a stored procedure, relevant fields being OrderID and ProductID. I have a group for each OrderID so the header info for each order gets displayed on each page with all the items with that OrderID displayed in the details section. This is the packing slip that goes with each order when shipped to the customer.
The bulk of the orders only have one item in them, so the production department needs to have these orders sorted by ProductID so when they package, they can go through X orders in a row that all have the same product.
When I group by OrderID maintaining the original sorted order (product count per order then ProductID), if the items returned are not sequential (ProductID's of 2 and 6 on one order and 4 and 7 on another), all each order's items don't get put in the same group. If I set the group to sort ascending, then the single item orders are no longer grouped (well, sorted) by ProductID. I tried to group in specified order, but the only field I can use as a conditional is the one I'm grouping by, which is not the group I want to sort by.
Am I making any sense? This is very frustrating because is seems so simple in my head but I can't find a way to do it.
________________________________________
Andrew