Jump to content
We've recently updated our Privacy Statement, available here ×

JasperReport Server password input control


brianbek

Recommended Posts

I have made a report that among other things requires the user to input his password. There are no JasperReportServer input controls that support a password input.

 

I will describe how I solved it but would also like to hear from the community if this is the right way to do it or there are another/better/simple way to do it.

 

Since there is no password input control I use a text input control. It have an ID called Password. I then copied the file DefaultParametersForm.jsp and added the following at the end:

 

<script type="text/javascript">

jQuery(document).ajaxComplete(function () {

  jQuery("#Password input").attr("type", "password”);

});

</script>

 

Please note: jQuery(document).ready… does not work! I also tried jQuery(document).trigger(‘report:controls_initialized’,{…});, which does not work either (see TIB_js-rptsrvr-amxbpm_5.6_ultimate.pdf page 155). 

 

After that I created a folder called ‘custom’ in …/WEB-INF/jsp/. And then copied the above file to it.

Then for the report I set the custom JSP file to be the above file.

This works - but is it the way to go?

 

For your pleasure here is the complete JSP file:

 

<%--Include templates--%>
<jsp:include page="../modules/inputControls/InputControlTemplates.jsp" />

 

<%-- input controls container --%>

<ul class="list inputControls" id="inputControlsContainer"></ul>


<script type="text/javascript">  jQuery(document).ajaxComplete(function () { jQuery("#Password input").attr("type", "password"); }); </script>

 

Note I am using the JasperReport server 6 community edition. The report was made with the latest Studio release version 6.x.

 

Regards Brian

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...