Forums

ASP

This topic is locked

nested repeat region....

Posted 05 Aug 2002 22:16:30
1
has voted
05 Aug 2002 22:16:30 danhq  posted:
hello,

my problem is this: i have a reporting system on the back end of a shopping cart (ultracart2 - works great!). in this reporting system the monthly transactions are pulled from the database via various queries. no problems there.
the problem is i'm trying to generate a region that shows subtotals for each customer. so - the example would be as follows: for july jimmy made 10 separate transactions, this would flow into a table, then the total of jimmy's july transactions would appear.
this process would repeat itself for each customer. so you'd have 10 customer transactions, then a total, then 10 more customer transactions, then total, etc.
i think i should be using either 1) a nested repeat region or 2) a join in the SQL. so far neither approach has worked.
any ideas?

Replies

Replied 06 Aug 2002 10:02:56
06 Aug 2002 10:02:56 Andrew Watson replied:
nested repeat will be fine.

simply create TWO unfiltered rescordsets one for Customers and one for Transactions.

Create your repeating Customer table as usual leaving a blank row in which to put your subdata.

now in this row create another repeating table (dont apply the repeat region to this, it wont allow you)

now manually apply a repeat to this and filter it each time for this customer...

<pre id=code><font face=courier size=2 id=code>
rsTransactions.Filter = "CustomerID = " & rsCustomers("CustomerID"
While Not rsTransactions.EOF
</font id=code></pre id=code>
<i>...display transaction code</i>
<pre id=code><font face=courier size=2 id=code>
rsTransaction.MoveNext
Wend
</font id=code></pre id=code>

This should do the trick.
cheers
Leed

:: Son, im Thirty.... ::

Edited by - leed on 06 Aug 2002 10:04:00
Replied 09 Aug 2002 17:08:11
09 Aug 2002 17:08:11 danhq  replied:
i ended up using the repeat region tutorial from this site ('nested repeat region using a recordset filter'). it still doesn't work quite the way i want it to however: the page will not run unless i display the subtotals BEFORE the transaction data. this is not a big deal, it's just not the 'standard' way to display things.....
thanks for the suggestion.

dan.

Replied 19 Aug 2002 15:51:54
19 Aug 2002 15:51:54 Andrew Watson replied:
you can also get what you want regards the totals just logically tally them as youre stepping thro'

:: Son, im Thirty.... ::

Reply to this topic