COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: coghelp on 14 Dec 2011 07:30:48 PM

Title: Update the script to work with the production
Post by: coghelp on 14 Dec 2011 07:30:48 PM
I have a HTML code (below) which is working fine in Dev and test but in production it is not able to access the file, the only difference I have seen is that in production we have security with LDAP and there is none in dev and test. Can you please tweak it to work in production also, I believe it must be accessing the location other then the LAN ID? I am trying to use csv file for the value prompt where in user enters values in csv.

If possible to include the LAN ID of the user who logged in by overwriting the Cognos security. We have same LDAP which we access both windows work station and Cognos 8.3

Here is the code:

<script>

var form = getFormWarpRequest();
var list1 = form._oLstChoicesABC;
upload(list1, "\\\\myserver\\TestData1.csv");

function upload(listPrompt, fileName) {
var objFSO, objTextFile;
var sReadLine, exception;
var ForReading = 1, ForWriting = 2, ForAppending = 8;

// clear the list
while (listPrompt.options.length != 0) {
listPrompt.options.remove(0);
}

try {
objFSO = new ActiveXObject("Scripting.FileSystemObject&quo t;);
objTextFile = objFSO.OpenTextFile(fileName, ForReading);
while (!objTextFile.AtEndOfStream) {
sReadLine = objTextFile.ReadLine();
listPrompt.options[listPrompt.options.length] = new Option(
sReadLine, sReadLine);
}
objTextFile.close();
} catch (exception) {
alert("Invalid file name" + fileName);
}
}

</script>
Title: Re: Update the script to work with the production
Post by: CognosPaul on 15 Dec 2011 03:50:59 PM
What error are you getting?

I don't see anything implicitly wrong with the script.  Is the prod server on the trusted sites list? IE might be preventing the JavaScript from reading the csv.

So you understand, the script isn't actually talking to the Cognos server. Everything is happening on the user's machine. The JavaScript collects the CSV then modifies the listPrompt tom atch the csv contents. Until the user presses finish, the only communication is between the client's machine and the server that's holding the csv.

What happens if you change the script to point to c:\temp\TestData1.csv, and have the user place the csv in that location on his computer?