Logging input control data

by Stas_P

HTML

<script type='text/javascript' src="https://mobiledemo.jaspersoft.com/jasperserver-pro/client/visualize.js"></script>

<!-- JQuery - compiled and minified -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

<div id="containerReportInput" class="containerInput">
  <div>
    <p>Loading...</p>
  </div>
</div>

CSS

.containerInput {
  width: 300px
}

JavaScript

/*
The sample prints the initial values of report Input Control(s) into console
It also re-prints the state of Input Control(s) each time the values are updated 
*/

visualize({
  auth: {
    name: "joeuser",
    password: "joeuser"
  }
}, function(v) {
  var icReport = v.inputControls({
    resource: "/public/Samples/Reports/ProfitDetailReport",
    container: "#containerReportInput",
    success: function(data) {
      console.log("Report IC:", data);
    },
    events: {
      change: function(data) {
        console.log(data);
      }
    }
  });
});