#1 2017-03-08 15:41:27

skosmas
Member
Registered: 2017-02-16

How do I make a script parameter dependant upon a text parameter?

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

#2 2017-03-08 16:09:02

eduardo
Administrator
Registered: 2016-11-01
Website

Re: How do I make a script parameter dependant upon a text parameter?

Hi skosmas,

take a look here:
https://forum.reportserver.net/viewtopic.php?id=758
#2

should do what you want.

Cheers,
Eduardo

Online

#3 2017-03-09 09:16:10

skosmas
Member
Registered: 2017-02-16

Re: How do I make a script parameter dependant upon a text parameter?

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

#4 2017-03-09 11:07:48

eduardo
Administrator
Registered: 2016-11-01
Website

Re: How do I make a script parameter dependant upon a text parameter?

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)

Online

#5 2017-03-09 14:02:18

skosmas
Member
Registered: 2017-02-16

Re: How do I make a script parameter dependant upon a text parameter?

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

#6 2017-03-10 10:45:52

eduardo
Administrator
Registered: 2016-11-01
Website

Re: How do I make a script parameter dependant upon a text parameter?

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

Online

#7 2017-03-10 11:40:27

skosmas
Member
Registered: 2017-02-16

Re: How do I make a script parameter dependant upon a text parameter?

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

#8 2017-03-10 12:14:11

eduardo
Administrator
Registered: 2016-11-01
Website

Re: How do I make a script parameter dependant upon a text parameter?

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

Online

#9 2017-03-10 12:22:19

skosmas
Member
Registered: 2017-02-16

Re: How do I make a script parameter dependant upon a text parameter?

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

#10 2017-03-13 11:06:43

eduardo
Administrator
Registered: 2016-11-01
Website

Re: How do I make a script parameter dependant upon a text parameter?

Hi skosmas,

the issue was corrected and will be fixed in the next reportserver version.

Cheers,
Eduardo

Online

Board footer

Powered by FluxBB