Forums

This topic is locked

Nested repeat region with data shaping

Posted 31 Oct 2002 11:24:56
1
has voted
31 Oct 2002 11:24:56 Jelle-Jacob de Vries posted:
I tried to post a review on the tutorial page of "Nested repeat region with data shaping" But it doesn't show any text, so I will post it here.

How can I use the show region behaviour depending on a value of the shaping recordsets?

For example: If the child recordset has not items related to the parent recordset,
I dont want the row where the child values are in, the be shown.

Couls you give an example code? The conditional region behaviour is not compatible with DMX!

Thank in advance

Replies

Replied 31 Oct 2002 11:49:51
31 Oct 2002 11:49:51 Vince Baker replied:
First, Create you parent recordset, then create your child recordset but filtered by the field you want in the parent recordset. (Do all this just like normal)

To do this, here is a sample of the recordsets:

Parent:

Select *
FROM yourparenttablename

Child recordset

Select *
FROM yourchildtablename
WHERE LinkFieldname = varLink

add a variable in the advanced recordset builder

varLink 1 rsNameofparentrecordset.fields.item("LinkFieldname".value

WHen you have built these recordsets add a repeat region on the parent recordset.
Just under the While statement of the repeat region copy and paste the child recordset code .

This will create your nested recordset.

Then,

<% If Not rsChildRecordsetname.EOF AND Not rsChildRecordsetname.BOF THen %>

<tr> what you want to be displayed </tr> (You will have to add <td></td>s to match your table format)

<% End IF %>

Et Voila!

Post back if you have any problems.

Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting

Edited by - bakerv on 31 Oct 2002 11:51:22
Replied 01 Nov 2002 14:05:21
01 Nov 2002 14:05:21 Jelle-Jacob de Vries replied:
Vince,

Thanks for your reply it realy works great, but what is this method different then the two tutorials on this site, Using datashaping or nested repeat region using a filter? Isn't your method the same as nested repeat region using a filter ? Could you tell me what the differences are between those 3?

Could you also tell me how to make a nested repeat region on the child recordset in your example ?

Thank in advance,

JJ

Edited by - jellejacob on 01 Nov 2002 14:06:25
Replied 01 Nov 2002 14:10:09
01 Nov 2002 14:10:09 Vince Baker replied:
They are all basicaly the same, the advantage of doing it this way is that you begin to understand what the code is doing which means that you can adapt if for different things.

To nested an additional recordset, look at the repeat region coding and duplicate it for the child table inside the initial recordset. Then, place a third recordset under the where statement of the second repeat region (sounds a bit confusing?)



Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 01 Nov 2002 14:15:45
01 Nov 2002 14:15:45 Jelle-Jacob de Vries replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
They are all basicaly the same, the advantage of doing it this way is that you begin to understand what the code is doing which means that you can adapt if for different things.

To nested an additional recordset, look at the repeat region coding and duplicate it for the child table inside the initial recordset. Then, place a third recordset under the where statement of the second repeat region (sounds a bit confusing?)


Why do I need a third recordset, can I not just copy the repeat region code from the parent recordset and place it to the needed place?


Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 04 Nov 2002 10:01:55
04 Nov 2002 10:01:55 Jelle-Jacob de Vries replied:
Why do I need a third recordset, can I not just copy the repeat region code from the parent recordset and place it to the needed place?


Jelle-Jacob

Reply to this topic