我循環通過查詢創建零件號碼列表填充部分號碼清單:添加查詢元素的列表到一個數組元素
<cfset binlist = "" >
<cfset a = 1 />
<cfloop query="getParts">
<cfif a >
<cfset binlist = getParts.binnum>
<cfset a = 2 >
<cfelse>
<cfset binlist = binlist & "," & getParts.binnum >
</cfif>
</cfloop>
我想將binlist元素添加到數組的元素以填充電子表格:
<cfset aColumns = [ partnum, shortchar08, partdescription, binlist, inventory.currinv , staged.stagedqty, alloc.allocqty, available, shelfCount, shipdtl.shipqty, getNumberofStores.numStores, tordered, APS, paddedLeadTime, LWM, storesRemain] />
<!---add the column data to the spreadsheet--->
<cfset SpreadsheetAddRow(SpreadsheetObj, ArrayToList(aColumns)) />
1部分可以在多個箱中。它適用於我的CF輸出頁面,但不適用於我試圖生成的電子表格,用於顯示零件的多個容器。
生成的電子表格只包含每個零件的一個容器,而不是具有多個容器的容器多個垃圾箱。
我不跟着你正在試圖做什麼? 此外,如果您可以在html中顯示代碼,您可以使用cfcontent作弊併發送html到excel。 此外,你可以簡單地如果你的初始邏輯大量使用ValueList()或ListAppend()如果你想在循環內部做其他邏輯仍然。 – Busches 2012-03-01 17:28:03
感謝Bushes的迴應,但是,binnum並沒有被限制在特定的部分。 – aparker81 2012-03-01 17:58:17