NetCharts® Server: ASP Toolkit getNDSDataAsCSV Example
This example shows how to utilize the NetCharts Server ASP Toolkit to retrieve data from a configured data source as CSV (Comma Separated Values). The CSV can be then saved, displayed to the user or modified as needed. The example uses the NetChartsServer.NSToolkit class to retrieve the data and then parses the CSV to display the data in an HTML table. See the Source Code.
Note: This is a static image - no interactivity.

Source Code
<html>
<head>
<title>NetCharts Server ASP Toolkit Example - getNDSDataAsCSV</title>
</head>
<body>
<p>Create an instance of the <i>NetChartsServer.NSToolKit</i> class.</p>
<%
Dim toolKit
Set toolKit = Server.CreateObject("NetChartsServer.NSToolKit")
toolKit.setProject "Examples/Suppliers"
toolKit.setServerInfo "localhost", 8001
%><p>The function <i>getNDSDataAsCSV</i> is used to get data from a
server configured data source formatted as a <b>CSV (Comma Separated Value)</b> string. <i>
(NOTE: In this example we ask for the delimiter to be a "/" instead of a "," because the
data might contain a comma. The data is parsed into an HTML table for display purposes)</i></p><div align="center">
<table border="1" width="80%">
<%
Dim csvData, splitCSVData, rowParts, rowsIndex, colsIndex
csvData = toolKit.getNDSDataAsCSV("SupplierByFacility.ndx", "/")
splitCSVData = Split(csvData, vbCrLf, -1, vbBinaryCompare)For rowsIndex = 0 To UBound(splitCSVData)
rowParts = Split(splitCSVData(rowsIndex), "/", -1, vbBinaryCompare)
%>
<tr>
<%
For colsIndex = 0 To UBound(rowParts)%>
<td>
<%=rowParts(colsIndex)%>
</td>
<%
Next
%>
</tr>
<%
Next
%>
</table>
</div><%
Set toolKit = Nothing
%>
</body>
</html>
![]()



