Command Line Configuration
Web Portal can also be used to call reports from your web-based application or even to send a user or a customer a command line, with parameters pre-filled out, to run a report. There are lots of options.
For starters, to see the basic structure of a command line for a report, just use the Generate button. For the most part, command lines auto-generate, but we still make the button available just to make sure you're getting the latest command line based on changes within the report edit window.
This command line automatically runs the report without any user interaction (passes 3 parameters, set the output type to PDF, and outputs it to the browser):
https://demo.knownkeep.com/ReportRunnerWebPortal/Result.aspx?report=Multiple%20Parameters%20Example&Parm0=This&Parm1=That&Parm2=The%20Other&OutputFormat=PDF,pdf&OutputMethod=browser
This command line shows the parameter prompt window (shown below) so the end user can make changes to parameter values (and even output formats and destinations if configured to do so):
https://demo.knownkeep.com/ReportRunnerWebPortal/ReportRunner.aspx?ReportName=Multiple%20Parameters%20Example
Note, if the end user has not logged in yet, the user will be shown the log in window, and once authenticated, the report prompt will be shown. Once the user authenticates, they will not need to reauthenticate "for the day" unless the browser session is closed or the app pool is recycled.
Now, by default, with the prompt above, the user can click three places and return to the main Report List window...
... you can DISABLE this functionality, though, if you do not want end users to SEE the main Web Portal interface. You do this by setting/changing the following setting in the web.config file (change 0 to 1):
<!-- Enable/Force Command Line Only Mode (Hide Main Interface) -->
<add key="HideEndUserPortal_CommandLineOnly" value="1" />
When you make that change, this is what the end user will see:
Notice how the tabs are gone and the footer has changed to Exit/Log Off?
And if the end user clicks on the Web Portal logo (your company logo) or tries to type in ReportList.aspx, they will only see this message:
With HideEndUserPortal_CommandLineOnly
set to 1, the end user can only run command lines, and has no access to anything else (other than a log in screen).
By the way, if the click on the Exit/Log Off option at the bottom, they will see this message:
Note, clicking Exit/Log Off will also require the user to sign back in when they run another command line.
Questions and Answers:
How do I prevent a user from modifying the command line and seeing data they shouldn't?
This is where user values come into play. These are configured in the Users administrator interface or in Active Directory (you have to add specific custom field names aka "attributes").
Non-AD/LDAP/LDAPS User:
AD/LDAP/LDAPS User Value:
With either set up, when you configure a report parameter, you can assign a user value to a parameter and HIDE it (so it can't be changed/overridden):
Note, for readability, the drop-down in the parameter block reads "User Value 1" (or 2 or 3), but when you add these custom attributes to Active Directory, you should NOT use spaces. Web Portal specifically looks for and fetches "UserValue1" (or 2 or 3).
Also note, this prevents users from OVERRIDING pre-set fields (with user values), too. If you set a parameter to be answered with a user value, if you get a "hacky" user who still tries to pass a value to that parameter, Web Portal will not allow this to happen. It will always be set to the user value.
Lastly, note, if you are testing and changing user values over and over in the same session, be sure and log out of the end user interface any time you change the user values. Otherwise, you will see the user values that were set prior to the last log in. For performance reasons, when a user logs into the Web Portal, the user values are fetched at that time, and they are NOT REFRESHED until the next time the user logs out and logs back in.
How can I modify the default command line messages (like "Access Denied" and "Exit Complete" above)?
All of the "generic" command line error and notification pages are standard HTML pages located in the root Web Portal folder. The GIF images used for those pages are in the Images sub-folder.
Note, we purposely use the same access denied image for report_access_denied_1.html, report_access_denied_2.html, report_access_denied_clerror.html, and report_access_denied_portal_disabled.html. This is on purpose for security reasons. The name of the HTML file tells use why the message is displaying, but there's no reason to tell the end user.
- report_access_denied_1: User is attempting to run a report without being authenticated. Technically, you should never see this specific message, but it's there as an extra safety check.
- report_access_denied_2: User is authenticated, but does not have access to the report user is trying to run (report has not been assigned to user's groups).
- report_access_denied_clerror: User is attempting a command line that is formatted incorrectly. For example, trying to run a command line without passing ReportName parameter.
- report_access_denied_portal_disabled: User is attempting to log into Web Portal or access ReportList.aspx when
HideEndUserPortal_CommandLineOnly
is enabled.