James Butler
New Member.
5425 views

Query user for parameters on running HTML Template report.

Jump to solution
I have an HTML Template report that I would like to query the user for parameters when it is run. How would you make this happen?
0 Likes
1 Solution

Accepted Solutions
James Butler
New Member.

Re: Query user for parameters on running HTML Template report.

Jump to solution
Okay Paul, I have an html page that contains a form prompting for the parameters I need, then on submit it calls another html page that has the call to https://myserver/tmtrack/tmtrack.dll?ScriptPage& yada yada yada...
The problem is when I use the URL https://myserver/tmtrack/tmtrack.dll?customhtml/myhtml.html to bring up the form, I don't get anything. I have my html file in the directory customhtml that is located in Serena/SBM/ApplicationEngine/bin directory which is suppose to be the virtual directory on the web server.
Any suggestions?

Solution is the URL doesn't need the tmtrack.dll? part, should just be
https://myserver/tmtrack/customhtml/myhtml.html

Works now.

View solution in original post

0 Likes
5 Replies
dsheaffe Outstanding Contributor.
Outstanding Contributor.

Re: Query user for parameters on running HTML Template report.

Jump to solution
Unless I have misunderstood your question, when setting up the report, in the "Search Filter" tab for the report, you select the field(s) that you want the user to be prompted for, and choose the "Query at Runtime" option. When they run the report they will then have to choose the values for the specified fields.
0 Likes
Highlighted
James Butler
New Member.

Re: Query user for parameters on running HTML Template report.

Jump to solution
The html template is calling an AppScript that generates the report. How do I get the parameters from the user and pass them to the script that the template is running? Is there a variable to can be placed in the $Script tag in the html template that automatically gets the parameters? Maybe something like $SCRIPT(, $PARAMS). But I can't just type the parameter value into that $SCRIPT tag, I need some kind of variable it knows about like $PARAM or something like that. Any ideas?
0 Likes
PM Thompson Acclaimed Contributor.
Acclaimed Contributor.

Re: Query user for parameters on running HTML Template report.

Jump to solution
I'm not sure how to do it with HTML context AppScript. The Script Guide does have a short example.

You could also do it with URL-context script. The HTML page would need to prompt the user for params then (using JavaScript) URL-encode these and append them to the URL used to activate the AppScript. For example, if the user is prompted for "First Name:" and enters "Esmerelda", the URL would be something like "http://myserver/tmtrack/tmtrack.dll?ScriptPage&ScriptName=MyReport&FirstName=Esmerelda"

Within the AppScript, use Shell.Params to get a Dictionary object containing the URL parameters, then extract your params from that:

str_UserFirstName = Shell.Params.Item("firstname") ' gets "Esmerelda"

Note that on the AppScript side, the param name specified in the URL ("FirstName") is lower-case ("firstname").
0 Likes
James Butler
New Member.

Re: Query user for parameters on running HTML Template report.

Jump to solution
Okay Paul, I have an html page that contains a form prompting for the parameters I need, then on submit it calls another html page that has the call to https://myserver/tmtrack/tmtrack.dll?ScriptPage& yada yada yada...
The problem is when I use the URL https://myserver/tmtrack/tmtrack.dll?customhtml/myhtml.html to bring up the form, I don't get anything. I have my html file in the directory customhtml that is located in Serena/SBM/ApplicationEngine/bin directory which is suppose to be the virtual directory on the web server.
Any suggestions?

Solution is the URL doesn't need the tmtrack.dll? part, should just be
https://myserver/tmtrack/customhtml/myhtml.html

Works now.

View solution in original post

0 Likes
dsheaffe Outstanding Contributor.
Outstanding Contributor.

Re: Query user for parameters on running HTML Template report.

Jump to solution
Sorry, can't help you with this one. It's way beyond my basic scripting knowledge
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.