You are not logged in.
How do I pass as an argument to a script parameter(let's say param2) the value of a text parameter(let's say param1)??
I made param2 to have a dependency upon param1 and on arguments of this parameter I have placed $P{param1} but it's not working.
Thanks in advance.
Offline
Hi skosmas,
take a look here:
https://forum.reportserver.net/viewtopic.php?id=758
#2
should do what you want.
Cheers,
Eduardo
Offline
Thanks, I have already seen that but I don't understand how should I reference the text parameter in the 'Arguments" section of the script parameter.
If I place param1, {param1} or $P{param1} I get this as a string and not the value of param1 in the input of the script.
Offline
Hi skosmas,
you can refer to your parameters as in all scripts, with parameterMap.
Example:
param2 script:
def html = """
<html>
<head>
<script type="text/javascript">
var callback;
function initParameter(param, cb){
alert("Current value: " + param.value);
callback = cb;
}
function setValue(value) {
alert("New value: " + value);
callback(value);
}
</script>
</head>
<body>
Hello """ + parameterMap['param1'] + """
<br>
</body>
</html>
"""
return html
Note that your script parameter must have a dependency on your referenced parameter (so param2 has to be dependent on param1).
Cheers,
Eduardo
(thanks @karolina for pointing this out)
Offline
Thank you very much. That's what I needed.
One more question ( I hope it's the last).
If I execute the report through dashboard, param2 calls the script that handles the value of param1.
However when I call the same report embedded in the Report Execution View with the following url
http://SERVER:PORT/reportserverbasedir/ReportServer.html#inlinereport/id:28160&p_param1:1502&type:parameter
I get a Status Code 500 Internal Server Error when the report tries to call the script for the second parameter.
How do I handle that issue?
Offline
Hello skosmas,
this seems to be a bug. I raised a ticket and will investigate this issue. Could you please check in the logs if you get an exception when you get the 500 Internal Server Error?
Regards,
Eduardo
Offline
I checked the directories "logs" that contain log files for apache and tomcat servers and the only that is writen that indicates an error is the following line in both "access" logfile of apache and "localhost_access_log" logfile of tomcat:
"POST /reportserver/reportserver/scriptreport HTTP/1.1" 500 57
Is there any other file or directory that I should look for?
Offline
If you installed with bitnami, the files here: C:\Bitnami\reportserverenterprise-3.0.2-6\apache-tomcat\logs
If not, the tomcat logs
Regards,
Eduardo
Offline
In the tomcat logs directory the only thing that I indicates an error is in the localhost_access_log.[date].txt that contains also the aforementioned line
127.0.0.1 - - [10/Mar/2017:13:26:38 +0200] "POST /reportserver/reportserver/scriptreport HTTP/1.1" 500 57
Offline
Hi skosmas,
the issue was corrected and will be fixed in the next reportserver version.
Cheers,
Eduardo
Offline