custom webpages on 1768 Eweb Module

italo2008

Member
Join Date
Feb 2009
Location
Padova
Posts
95
Hi

I must write a custom webpage, from wich a user can save a csv file that contains the controller tags and their values. I use a 1768-eweb module and a Compactlogix L43. I found this code on the Internet (there is a table with casual data an it would create a csv file with these data)

<html>
<head>
<script type="text/javascript">
function WriteCSVFile()
{
var x = myTable.rows
var ForWriting = 2
var ForAppending = 8
var TriStateFalse = 0

var fsObj = new ActiveXObject("Scripting.FileSystemObject")

var newFile = fsObj.OpenTextFile("/user/web/ClientSideJScriptFile.csv", ForWriting, true, TriStateFalse)

for (i = 0; i < x.length; i++)
{
var y = x.cells
var strTmp = y[0].innerText
if (y.length > 0)
{
for (j = 1; j < y.length; j++)
{
strTmp = strTmp + "," + y[j].innerText
}
}

newFile.WriteLine(strTmp)
}

newFile.Close()

}

</script>

</head>

<body lang=EN-US background="back.gif" link=blue vlink=purple>

<form>
<input type="button" onclick="WriteCSVFile()" value="Create CSV File">
</form>

<%
Put any table here, your little ol heart desireth
If you change the id, you gotta change it in the script
%>

<table id="myTable" border="1">
<tr> <td>Abe </td> <td>23</td> </tr>
<tr> <td>Betty </td> <td>34</td> </tr>
<tr> <td>Carol </td> <td>56</td> </tr>
<tr> <td>David </td> <td>24</td> </tr>
<tr> <td>Edward</td> <td>16</td> </tr>
<tr> <td>Floyd </td> <td>19</td> </tr>
<tr> <td>Gary </td> <td>38</td> </tr>
<tr> <td>Harold</td> <td>28</td> </tr>
</table>

</body>
</html>

I downloaded the page on the module,but it doesn't work (the page loads correctly but an error occurs when I click on the button: the ActiveX object can't be created. What can I do?
 
Last edited:

Similar Topics

Hi everyone, I'm working on the Micrologix 1400 and trying to make some custom webpages for a customer. I can display the datatables with a...
Replies
6
Views
4,938
Good day! I am working on a project at our campus to integrate fleet vehicle chargers with load management so we don't overwhelm our service. The...
Replies
37
Views
3,802
I imported a customised shape into the project, but I don't know how to actually add into on to a specific HMI screen. Do I use the Graphics menu...
Replies
2
Views
659
I'm testing the ability to make a custom ActiveX control for PVP7 applications to be able to write data out in an XML format. With my simple...
Replies
0
Views
648
I am having difficulty finding documentation or examples on integrating Visual Studio with iX Developer in order to develop custom objects...
Replies
0
Views
538
Back
Top Bottom