M
Mangler
I will try my best to explain this....
I have 2 recordsets, one pulls the main info and the other pulls
detailed info for the specific record and it get repeated. So:
Record1 :
(Master recordset result)
Repair price : $20 Labor : $5
(Detail recordet result)
part 1 : $2
part 2 : $2
Record2 :
(Master recordset result)
Repair price : $25 Labor : $10
(Detail recordet result)
part 1 : $2
part 2 : $2
part 3 : $5
I cannot figure out how to get the sum for each individual record. I
figured out how it can be done with a single repeat region but not
with a nested one adding information with another region. The results
I am looking for are as follows :
Record1 :
(Master recordset result)
Repair price : $20 Labor : $5
(Detail recordet result)
part 1 : $2
part 2 : $2
Record1 Total :$29
Record2 :
(Master recordset result)
Repair price : $25 Labor : $10
(Detail recordet result)
part 1 : $2
part 2 : $2
part 3 : $5
Record2 Total :$44
Here is the code for the main repeat region with the nested one
inside :
<%
While ((Repeat_master1workOrder__numRows <> 0) AND (NOT
master1workOrder.EOF))
%>
<table width="100%" border="1" cellspacing="0"
cellpadding="0">
<tr>
<td><table width="100%" border="0">
<tr>
<td colspan="2"><span class="style4"><%=
(master1workOrder.Fields.Item("phoneModel").Value) & " ( " &
(master1workOrder.Fields.Item("phoneESN_IMEI").Value) & " )" & " ::
WO# " & (master1workOrder.Fields.Item("workOrderNumber").Value)%></
span> <em>
<% If (master1workOrder.Fields.Item
("outboundTrackingNumber").Value) <> "" Then %>
<span class="style3">Tracking : <%=
(master1workOrder.Fields.Item("outboundTrackingNumber").Value)%></
span>
<%End If%>
</em>
<table width="100%" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td> <span class="style3"><em>Repair : <
%= FormatCurrency((master1workOrder.Fields.Item("salePrice").Value),
-1, -2, -2, -2) %> Labor : <%= FormatCurrency
((master1workOrder.Fields.Item("manHourCost").Value), -1, -2, -2, -2)
%> Shipping : <%= FormatCurrency((master1workOrder.Fields.Item
("shippingCost").Value), -1, -2, -2, -2) %></em></span></td>
<td><div align="right" class="style3"><%=
FormatCurrency((master1workOrder.Fields.Item("salePrice").Value) +
(master1workOrder.Fields.Item("manHourCost").Value) +
(master1workOrder.Fields.Item("shippingCost").Value), -1, -2, -2, -2)
%></div></td>
</tr>
</table></td>
</tr>
<%
nst_sw = false
detail2workOrderParts_cmd.Parameters("param1").Value = CInt("0" +
master1workOrder.Fields.Item("workOrderNumber").Value)
Set detail2workOrderParts = detail2workOrderParts_cmd.Execute
While (NOT detail2workOrderParts.EOF)
'Nested repeat
%>
<tr>
<td><div align="left"> <span
class="style3"> <%=(detail2workOrderParts.Fields.Item
("filledSKU").Value)%> ( <%=(detail2workOrderParts.Fields.Item
("partDescription").Value)%> )</span></div>
<div align="left"></div></td>
<td width="33%"><div align="right"
class="style3"><%= FormatCurrency((detail2workOrderParts.Fields.Item
("salePrice").Value), -1, -2, -2, -2) %></div></td>
</tr> <%
' Nested move next
detail2workOrderParts.MoveNext()
Wend
%>
<tr>
<td> </td>
<td>Total :</td>
</tr>
</table></td>
</tr>
</table>
<%
Repeat_master1workOrder__index=Repeat_master1workOrder__index+1
Repeat_master1workOrder__numRows=Repeat_master1workOrder__numRows-1
master1workOrder.MoveNext()
Wend
%>
I can post the recordsets too if needed, just left them out at first
to not take up too much space in this post.
I have 2 recordsets, one pulls the main info and the other pulls
detailed info for the specific record and it get repeated. So:
Record1 :
(Master recordset result)
Repair price : $20 Labor : $5
(Detail recordet result)
part 1 : $2
part 2 : $2
Record2 :
(Master recordset result)
Repair price : $25 Labor : $10
(Detail recordet result)
part 1 : $2
part 2 : $2
part 3 : $5
I cannot figure out how to get the sum for each individual record. I
figured out how it can be done with a single repeat region but not
with a nested one adding information with another region. The results
I am looking for are as follows :
Record1 :
(Master recordset result)
Repair price : $20 Labor : $5
(Detail recordet result)
part 1 : $2
part 2 : $2
Record1 Total :$29
Record2 :
(Master recordset result)
Repair price : $25 Labor : $10
(Detail recordet result)
part 1 : $2
part 2 : $2
part 3 : $5
Record2 Total :$44
Here is the code for the main repeat region with the nested one
inside :
<%
While ((Repeat_master1workOrder__numRows <> 0) AND (NOT
master1workOrder.EOF))
%>
<table width="100%" border="1" cellspacing="0"
cellpadding="0">
<tr>
<td><table width="100%" border="0">
<tr>
<td colspan="2"><span class="style4"><%=
(master1workOrder.Fields.Item("phoneModel").Value) & " ( " &
(master1workOrder.Fields.Item("phoneESN_IMEI").Value) & " )" & " ::
WO# " & (master1workOrder.Fields.Item("workOrderNumber").Value)%></
span> <em>
<% If (master1workOrder.Fields.Item
("outboundTrackingNumber").Value) <> "" Then %>
<span class="style3">Tracking : <%=
(master1workOrder.Fields.Item("outboundTrackingNumber").Value)%></
span>
<%End If%>
</em>
<table width="100%" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td> <span class="style3"><em>Repair : <
%= FormatCurrency((master1workOrder.Fields.Item("salePrice").Value),
-1, -2, -2, -2) %> Labor : <%= FormatCurrency
((master1workOrder.Fields.Item("manHourCost").Value), -1, -2, -2, -2)
%> Shipping : <%= FormatCurrency((master1workOrder.Fields.Item
("shippingCost").Value), -1, -2, -2, -2) %></em></span></td>
<td><div align="right" class="style3"><%=
FormatCurrency((master1workOrder.Fields.Item("salePrice").Value) +
(master1workOrder.Fields.Item("manHourCost").Value) +
(master1workOrder.Fields.Item("shippingCost").Value), -1, -2, -2, -2)
%></div></td>
</tr>
</table></td>
</tr>
<%
nst_sw = false
detail2workOrderParts_cmd.Parameters("param1").Value = CInt("0" +
master1workOrder.Fields.Item("workOrderNumber").Value)
Set detail2workOrderParts = detail2workOrderParts_cmd.Execute
While (NOT detail2workOrderParts.EOF)
'Nested repeat
%>
<tr>
<td><div align="left"> <span
class="style3"> <%=(detail2workOrderParts.Fields.Item
("filledSKU").Value)%> ( <%=(detail2workOrderParts.Fields.Item
("partDescription").Value)%> )</span></div>
<div align="left"></div></td>
<td width="33%"><div align="right"
class="style3"><%= FormatCurrency((detail2workOrderParts.Fields.Item
("salePrice").Value), -1, -2, -2, -2) %></div></td>
</tr> <%
' Nested move next
detail2workOrderParts.MoveNext()
Wend
%>
<tr>
<td> </td>
<td>Total :</td>
</tr>
</table></td>
</tr>
</table>
<%
Repeat_master1workOrder__index=Repeat_master1workOrder__index+1
Repeat_master1workOrder__numRows=Repeat_master1workOrder__numRows-1
master1workOrder.MoveNext()
Wend
%>
I can post the recordsets too if needed, just left them out at first
to not take up too much space in this post.