Jump to content

Using remote jasper server visualize API


aksharaloni

Recommended Posts

Hi,

Most of the examples I saw under visualize.js are using localhost. I do not have jasperserver installed on local, so I am trying to connect to remote server to create sample html using visualize.js. But I am not able to see the report on html and getting below error.

TypeError: t is null
Line 64

Here is simple html:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test Visualize</title>
 
</head>
<body>
<h2>Simple Visualize.js</h2>
<div id="container"></div>
<script type="text/javascript" src="http://myremoteserver:8080/reportservice/client/visualize.js"></script>
<script type="text/javascript">
visualize(
    {
        auth:{
        name:"admin",
        password:"admin",
organization:"test"
        }
    },function (v){
//render report from provided resource
    v("#container").report({
        resource: "/organizations/test/temp/MyReport",
        error: handleError
    });
    //show error
    function handleError(err) {
        alert(err.message);
    }
});
</script>
</body>
</html>
 
I am wondering if remote server is supported or not. If not how can I create simple html and test report with visualize.js ?
 
Thanks
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Remote servers are supported because I'm using it in one of my site.

I just tested it on a local server and replaced the server ip address afterward.

There may be a firewall preventing access.

1. Check if visualize.js file on the remote server can be opened from the web browser.

2. Check if the report can be accessed using REST v2 API.

Link to comment
Share on other sites

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...