Passing query parameters with authentication request visualize.js

I am using jasper's visualize.js to display report in a web page. I have created a sample html and need to perform the token based auth. Also i need to pass some query parameters with the auth request. below is my code

 

<!DOCTYPE html>
<html>
  <head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <title></title>
 
  </head>
  <body>
 
<!-- Provide the URL to visualize.js -->
 
<div id="container"></div>
<!-- Provide a container for the report -->
 
<script src="http://localhost:8081/jasperserver-pro/client/visualize.js?logLevel=error&_opt=true"></script>
 
<script>
var str = $.param({ districtId: 12345});
visualize({
  auth: {
    token:"Bearer%20r5srPawAH6xzK8KlxqnkD8B1W4nS3SmZgxk1j4P4mRzCBwLArNGdTgKAlYuMQrwh",
    queryParams:str,
    preAuth: true,
    tokenName:"token"
 
  }
}, function(v) {
alert("success");},
 
function(err){
    alert(err);
});
</script>
 
 
 
  </body>
</html>

I am getting error saying that queryParams in unknown property. I checked the API but it is there in the definition. What is wrong in my usage ?

Please help,

Thank you,

Thusira

thusira.dissanayake's picture
Joined: Dec 22 2016 - 9:09pm
Last seen: 5 years 11 months ago

Why do you pass the query parameter during auth? Could you not pass the values during report execution?

rpeguet - 2 years 8 months ago

0 Answers:

No answers yet
Feedback