<%
... some variable set up ....
queryString = as400url + username + "+landedcost+" + fileid
Set xmldoc = ReadXMLFromAS400 (queryString)
customername = ReadXML (xmldoc, "//customername")
entrynumber = ReadXML (xmldoc, "//entrynumber")
crossreference = ReadXML (xmldoc, "//crossreference")
set nodelist = xmldoc.selectNodes("//itemrecord")
// Set up columns for excel, only show column if there is data
dim columnlabels(), columntags(), columnwidths()
dim objTest
redim preserve columnlabels (50)
redim preserve columntags (50)
redim preserve columnwidths (50)
i = 0
Set objTest = nodelist(counter).selectSinglenode("invoicenumber").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Invoice #"
oShowInvoice = true
columnwidths(i) = "70"
i = i + 1
else
oShowInvoice = false
end if
Set objTest = nodelist(counter).selectSinglenode("ponumber").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "P.O.#"
oShowPONumber = true
columnwidths(i) = "70"
i = i + 1
else
oShowPONumber = false
end if
Set objTest = nodelist(counter).selectSinglenode("itemnumber").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Item/ SKU/ Style"
oShowItem = true
columnwidths(i) = "70"
i = i + 1
else
oShowItem = false
end if
Set objTest = nodelist(counter).selectSinglenode("store").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Store/ Div"
oShowStore = true
columnwidths(i) = "70"
i = i + 1
else
oShowStore = false
end if
Set objTest = nodelist(counter).selectSinglenode("department").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Department"
oShowDept = true
columnwidths(i) = "70"
i = i + 1
else
oShowDept = false
end if
Set objTest = nodelist(counter).selectSinglenode("htsnumber").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "HTS No."
oShowHTS = true
columnwidths(i) = "70"
i = i + 1
else
oShowHTS = false
end if
Set objTest = nodelist(counter).selectSinglenode("origincountry").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Origin Country"
oShowOriginCntry = true
columnwidths(i) = "70"
i = i + 1
else
oShowOriginCntry = false
end if
Set objTest = nodelist(counter).selectSinglenode("manufacturerid").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "MID #"
oShowMID = true
columnwidths(i) = "70"
i = i + 1
else
oShowMID = false
end if
Set objTest = nodelist(counter).selectSinglenode("spi").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "SPI"
oShowSPI = true
columnwidths(i) = "70"
i = i + 1
else
oShowSPI = false
end if
Set objTest = nodelist(counter).selectSinglenode("masterbilllading").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Master BL/AWB #"
oShowMBL = true
columnwidths(i) = "70"
i = i + 1
else
oShowMBL = false
end if
Set objTest = nodelist(counter).selectSinglenode("housebilllading").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "House BL/AWB #"
oShowHBL = true
columnwidths(i) = "70"
i = i + 1
else
oShowHBL = false
end if
Set objTest = nodelist(counter).selectSinglenode("containernumber").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Container #"
oShowContainer = true
columnwidths(i) = "70"
i = i + 1
else
oShowContainer = false
end if
Set objTest = nodelist(counter).selectSinglenode("containertype").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Container Type"
oShowContainerType = true
columnwidths(i) = "70"
i = i + 1
else
oShowContainerType = false
end if
Set objTest = nodelist(counter).selectSinglenode("cartons").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "CTN"
oShowCTN = true
columnwidths(i) = "70"
i = i + 1
else
oShowCTN = false
end if
Set objTest = nodelist(counter).selectSinglenode("pieces").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Pieces"
oShowPieces = true
columnwidths(i) = "70"
i = i + 1
else
oShowPieces = false
end if
Set objTest = nodelist(counter).selectSinglenode("unitprice").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Unit Price"
oShowUnitPrice = true
columnwidths(i) = "70"
i = i + 1
else
oShowUnitPrice = false
end if
Set objTest = nodelist(counter).selectSinglenode("cubicmeter").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Cubic Mtr"
oShowCBM = true
columnwidths(i) = "70"
i = i + 1
else
oShowCBM = false
end if
Set objTest = nodelist(counter).selectSinglenode("weight").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Weight"
oShowWeight = true
columnwidths(i) = "70"
i = i + 1
else
oShowWeight = false
end if
Set objTest = nodelist(counter).selectSinglenode("value").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Value"
oShowValue = true
columnwidths(i) = "70"
i = i + 1
else
oShowValue = false
end if
Set objTest = nodelist(counter).selectSinglenode("duty").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Duty"
oShowDuty = true
columnwidths(i) = "70"
i = i + 1
else
oShowDuty = false
end if
Set objTest = nodelist(counter).selectSinglenode("advaloremrate").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Duty Rate (Advalorem)"
oShowAdvaloremRate = true
columnwidths(i) = "70"
i = i + 1
else
oShowAdvaloremRate = false
end if
Set objTest = nodelist(counter).selectSinglenode("specificrate").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Duty Rate (Specific)"
oShowSpecificRate = true
columnwidths(i) = "70"
i = i + 1
else
oShowSpecificRate = false
end if
Set objTest = nodelist(counter).selectSinglenode("supplementalrate").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Duty Rate (Supplemental)"
oShowSupplementalRate = true
columnwidths(i) = "70"
i = i + 1
else
oShowSupplementalRate = false
end if
Set objTest = nodelist(counter).selectSinglenode("hmf").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "HMF"
oShowHMF = true
columnwidths(i) = "70"
i = i + 1
else
oShowHMF = false
end if
Set objTest = nodelist(counter).selectSinglenode("mpf").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "MPF"
oShowMPF = true
columnwidths(i) = "70"
i = i + 1
else
oShowMPF = false
end if
Set objTest = nodelist(counter).selectSinglenode("freight").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Freight"
oShowFreight = true
columnwidths(i) = "70"
i = i + 1
else
oShowFreight = false
end if
Set objTest = nodelist(counter).selectSinglenode("exam").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Exam"
oShowExam = true
columnwidths(i) = "70"
i = i + 1
else
oShowExam = false
end if
Set objTest = nodelist(counter).selectSinglenode("assistcost").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Assist Cost"
oShowAssist = true
columnwidths(i) = "70"
i = i + 1
else
oShowAssist = false
end if
Set objTest = nodelist(counter).selectSinglenode("tax").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Tax"
oShowTax = true
columnwidths(i) = "70"
i = i + 1
else
oShowTax = false
end if
Set objTest = nodelist(counter).selectSinglenode("cottonfee").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Cotton Fee"
oShowCotton = true
columnwidths(i) = "70"
i = i + 1
else
oShowCotton = false
end if
Set objTest = nodelist(counter).selectSinglenode("otherfee").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Other Fee"
oShowOtherFee = true
columnwidths(i) = "70"
i = i + 1
else
oShowOtherFee = false
end if
Set objTest = nodelist(counter).selectSinglenode("brokerfee").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Broker Fee"
oShowBroker = true
columnwidths(i) = "70"
i = i + 1
else
oShowBroker = false
end if
Set objTest = nodelist(counter).selectSinglenode("othercharge").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "Other Charge"
oShowOtherCharge = true
columnwidths(i) = "70"
i = i + 1
else
oShowOtherCharge = false
end if
Set objTest = nodelist(counter).selectSinglenode("addcasenumber").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "ADD #"
oShowADDNumber = true
columnwidths(i) = "70"
i = i + 1
else
oShowADDNumber = false
end if
Set objTest = nodelist(counter).selectSinglenode("addduty").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "ADD Duty"
oShowADDDuty = true
columnwidths(i) = "70"
i = i + 1
else
oShowADDDuty = false
end if
Set objTest = nodelist(counter).selectSinglenode("cvdcasenumber").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "CVD #"
oShowCVDNumber = true
columnwidths(i) = "70"
i = i + 1
else
oShowCVDNumber = false
end if
Set objTest = nodelist(counter).selectSinglenode("cvdduty").firstChild
if Not (objTest is Nothing) Then
columnlabels(i) = "CVD Duty"
oShowCVDDuty = true
columnwidths(i) = "70"
i = i + 1
else
oShowCVDDuty = false
end if
%>