Good day,
I have problem accessing a file over the network in JavaScript.Can anyone please help me by having a look at where my problem could be.Below is the code.Thanks very much
<script language="JavaScript">
var fso, f, s="";
fso = new ActiveXObject("Scripting.FileSystemObject");
// This is my UNC file path
f = fso.GetFile("\\\\myserver\\c$\\Cube.txt");
s += "Last Updated: " + f.DateLastModified;
// Define the required references to the pivot table
var objPivot = document.all."AWD Outstanding Queues";
// connect to the sales cube
objPivot.ConnectionString = "Provider=msolap;Data Source=KMSRV.momentum.co.za;Initial Catalog=Knowledge";
objPivot.DataMember = "AWD_Outstanding_Queues";
// define column definitions
var objView = objPivot.ActiveView;
var objFlds = objPivot.ActiveView.FieldSets;
objView.ColumnAxis.InsertFieldSet(objFlds("[Outstanding Bands]"));
objView.RowAxis.InsertFieldSet(objFlds("[Region]"));
// objView.RowAxis.InsertFieldSet(objFlds("[Movement]"));
objView.DataAxis.InsertTotal(objView.Totals("Count"));
// specify the format of the output and caption
var str1 = "AWD Outstanding Queues - ";
var str2 = s;
var s = str1.concat(str2);
objView.TitleBar.Caption = s
// objView.Totals("Commission").NumberFormat = "#,#;- #,#"
// objView.Totals("Production").NumberFormat = "#,#;- #,#"
// objView.Totals("Advisor Api").NumberFormat = "#,#;- #,#"
// objView.Totals("Production credits").NumberFormat = "#,#;- #,#"
// objView.Totals("Target").NumberFormat = "#,#;- #,#"
// objView.Totals("% Over/Under Target").NumberFormat = "#,#;- #,#"
objView.Totals("Count").NumberFormat = "#,#;- #,#"
// display the required control options
objPivot.DisplayFieldList = 1;
objPivot.AllowFiltering = 1;
objPivot.DisplayExpandIndicator = 1;
objPivot.DisplayToolbar = 1;
</script>
</html>
I have problem accessing a file over the network in JavaScript.Can anyone please help me by having a look at where my problem could be.Below is the code.Thanks very much
<script language="JavaScript">
var fso, f, s="";
fso = new ActiveXObject("Scripting.FileSystemObject");
// This is my UNC file path
f = fso.GetFile("\\\\myserver\\c$\\Cube.txt");
s += "Last Updated: " + f.DateLastModified;
// Define the required references to the pivot table
var objPivot = document.all."AWD Outstanding Queues";
// connect to the sales cube
objPivot.ConnectionString = "Provider=msolap;Data Source=KMSRV.momentum.co.za;Initial Catalog=Knowledge";
objPivot.DataMember = "AWD_Outstanding_Queues";
// define column definitions
var objView = objPivot.ActiveView;
var objFlds = objPivot.ActiveView.FieldSets;
objView.ColumnAxis.InsertFieldSet(objFlds("[Outstanding Bands]"));
objView.RowAxis.InsertFieldSet(objFlds("[Region]"));
// objView.RowAxis.InsertFieldSet(objFlds("[Movement]"));
objView.DataAxis.InsertTotal(objView.Totals("Count"));
// specify the format of the output and caption
var str1 = "AWD Outstanding Queues - ";
var str2 = s;
var s = str1.concat(str2);
objView.TitleBar.Caption = s
// objView.Totals("Commission").NumberFormat = "#,#;- #,#"
// objView.Totals("Production").NumberFormat = "#,#;- #,#"
// objView.Totals("Advisor Api").NumberFormat = "#,#;- #,#"
// objView.Totals("Production credits").NumberFormat = "#,#;- #,#"
// objView.Totals("Target").NumberFormat = "#,#;- #,#"
// objView.Totals("% Over/Under Target").NumberFormat = "#,#;- #,#"
objView.Totals("Count").NumberFormat = "#,#;- #,#"
// display the required control options
objPivot.DisplayFieldList = 1;
objPivot.AllowFiltering = 1;
objPivot.DisplayExpandIndicator = 1;
objPivot.DisplayToolbar = 1;
</script>
</html>