Cheers Steve :-)
I was trying to output directly from the structure but kept getting errors
with my nested looping. Never thought of doing it this way, thanks very
much
jamo
or should you thank me for stemming your boredom :-)
> Jamie
>
> Here you go
>
> I was bored
>
> Either use the query that gets generated which I think will be easier to
> work with or you can output directly in the CFLOOP areas. You can see what
> is creating the access to the structure variable values
>
>
>
> ////////////////////////////////////////////////////////
> <!--- Set up dummy query --->
> <cfset orderQuery =
> queryNew("ID,VendorID,VendorName,Postage,VendorSubTotal,VendorTotal,ProductI
> D,ProductName,ItemPrice,Options,Qty,TotalPrice,OrderTotal")>
>
> <!--- Loop vendors --->
> <cfloop collection="#order.vendors#" item="vendor">
> <!--- Loop over products struct --->
> <cfloop collection="#order.vendors[vendor].products#"
> item="productStruct">
> <!--- Add roe to query and populate cells --->
> <cfset queryAddRow(orderQuery)>
> <cfscript>
>
> querySetCell(orderQuery,"ID",orderQuery.recordCount);
> querySetCell(orderQuery, "VendorID", vendor);
> querySetCell(orderQuery, "VendorName",
> order.vendors[vendor].Name);
> querySetCell(orderQuery, "Postage",
> order.vendors[vendor].postage);
> querySetCell(orderQuery, "VendorSubtotal",
> order.vendors[vendor].vendorSubtotal);
> querySetCell(orderQuery, "VendorTotal",
> order.vendors[vendor].VendorTotal);
> querySetCell(orderQuery, "ProductID",
> order.vendors[vendor].products[productStruct].ID);
> querySetCell(orderQuery, "ProductName",
> order.vendors[vendor].products[productStruct].Name);
> querySetCell(orderQuery, "ItemPrice",
> order.vendors[vendor].products[productStruct].ItemPrice);
> querySetCell(orderQuery, "Options",
> order.vendors[vendor].products[productStruct].Options);
> querySetCell(orderQuery, "Qty",
> order.vendors[vendor].products[productStruct].Quantity);
> querySetCell(orderQuery, "TotalPrice",
> order.vendors[vendor].products[productStruct].TotalPrice);
> querySetCell(orderQuery, "OrderTotal",
> order.OrderTotal);
> </cfscript>
> </cfloop>
> </cfloop>
>
> <cfoutput query="orderQuery" group="VendorID">
> #VendorName# (#VendorID#)<br>
> <cfoutput>
> #ProductName#
> (#ProductID#)<br>
> </cfoutput>
> <br>
> </cfoutput>
> ////////////////////////////////////////////////////////////////////////
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Jamie Lawrence
> Jenner
> Sent: Saturday, July 03, 2004 1:43 AM
> To: CFAussie Mailing List
> Subject: [cfaussie] problem outputting a structure
>
> hi guys,
>
> i have a beefy structure, which is to be looped over and outputted. It is
> for a retail site i am developing which allows multiple retailers to trade
> from one site, You can see the structure by going here
>
> <a
> href="http://www.webgremlins.net/example.cfm">http://www.webgremlins.net/exa
> mple.cfm</a>
>
> Each order can have multiple retailers, which in turn can have multiple
> products. each product has a set of fixed attributes, name quantity etc.
>
> i need to output the vendors, grouped by their unique ref code, then
> output all of the products which that vendor has in the structure, along
> with all of the attributes for each product. i have frazzled my brain
> trying, maybe its cos its friday!
>
> any help would be greatly appreciated
>
> cheers
>
> jamo
>
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to [EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/