# Customized Panes for 'xxxxxxxx' Created: 2009/04/09 # PANE:Supplier Monthly Purchases Graph [PANE] ADMIN xxxxxxxx 01000Supplier Monthly Purchases 010 000000500000INVPEN011M000 [VBSCRIPT] ' This script contains functions for customized pane events. ' You must not modify the name of the functions. Option Explicit Function CustomizedPane_OnLoad() dim GraphProperties GraphProperties = GraphProperties & "" GraphProperties = GraphProperties & "" GraphProperties = GraphProperties & "" GraphProperties = GraphProperties & "" GraphProperties = GraphProperties & "</AxisX>" GraphProperties = GraphProperties & "<AxisY><Title Text='Amount' /></AxisY>" GraphProperties = GraphProperties & "</Panel>" GraphProperties = GraphProperties & "</Panels>" GraphProperties = GraphProperties & "<Series LegendText='Amount' Style='Bar' />" GraphProperties = GraphProperties & "</CodejockChart>" CustomizedPane.CodeObject.GraphProperties = GraphProperties RefreshGraph() End Function Function CustomizedPane_OnRefresh() RefreshGraph() End Function Function RefreshGraph() ' Specify the variables to be used when calling the business object dim XMLOut, XMLParam, Supplier, PurchValMth1 dim Node(12) ' Populate the Stockcode variable with the refresh value Supplier = CustomizedPane.CodeObject.RefreshValue if Supplier = "" then exit function end if ' Build up the XML that will be supplied to the business object XMLParam = XMLParam & " <Query>" XMLParam = XMLParam & " <Key>" XMLParam = XMLParam & " <Supplier>" & Supplier & "</Supplier>" XMLParam = XMLParam & " </Key>" XMLParam = XMLParam & " <Option>" XMLParam = XMLParam & " <IncludeInvoices>N</IncludeInvoices>" XMLParam = XMLParam & " <IncludeReceipts>N</IncludeReceipts>" XMLParam = XMLParam & " <IncludeScrapReject>N</IncludeScrapReject>" XMLParam = XMLParam & " </Option>" XMLParam = XMLParam & " </Query>" on error resume next ' Call the business object, supplying the XML and putting the result in to XMLOut XMLOut = CallBO("APSQRY",XMLParam,"auto") if err then exit function end if ' Switch on error handling on error goto 0 'Load the XmlOut into the DOM Dim xmlDoc, MyVar, FinalString, Count Set xmlDoc = createobject("Msxml2.DOMDocument") xmlDoc.async = false xmlDoc.LoadXML(XMLOut) Set Node(1) = xmlDoc.SelectSingleNode("//PurchValMth1") Set Node(2) = xmlDoc.SelectSingleNode("//PurchValMth2") Set Node(3) = xmlDoc.SelectSingleNode("//PurchValMth3") Set Node(4) = xmlDoc.SelectSingleNode("//PurchValMth4") Set Node(5) = xmlDoc.SelectSingleNode("//PurchValMth5") Set Node(6) = xmlDoc.SelectSingleNode("//PurchValMth6") Set Node(7) = xmlDoc.SelectSingleNode("//PurchValMth7") Set Node(8) = xmlDoc.SelectSingleNode("//PurchValMth8") Set Node(9) = xmlDoc.SelectSingleNode("//PurchValMth9") Set Node(10) = xmlDoc.SelectSingleNode("//PurchValMth10") Set Node(11) = xmlDoc.SelectSingleNode("//PurchValMth11") Set Node(12) = xmlDoc.SelectSingleNode("//PurchValMth12") FinalString = FinalString & "<CodejockChart>" FinalString = FinalString & "<Series><Points>" For Count = 1 To 12 FinalString = FinalString & "<Point Label='" & Count & "' Value='" & Node(Count).text & "' />" Next FinalString = FinalString & "</Points></Series>" CustomizedPane.CodeObject.GraphData = FinalString & "</CodejockChart>" set xmldoc = nothing End Function